diff --git a/src/generated/Chats/Item/Messages/MessagesRequestBuilder.cs b/src/generated/Chats/Item/Messages/MessagesRequestBuilder.cs index 2feb7208f6..3fa2d62274 100644 --- a/src/generated/Chats/Item/Messages/MessagesRequestBuilder.cs +++ b/src/generated/Chats/Item/Messages/MessagesRequestBuilder.cs @@ -62,14 +62,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Send a new chatMessage in the specified channel or a chat. - /// Find more info here + /// Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message. + /// Find more info here /// /// A public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Send a new chatMessage in the specified channel or a chat.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chatmessage-post?view=graph-rest-1.0"; + command.Description = "Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chat-post-messages?view=graph-rest-1.0"; var chatIdOption = new Option("--chat-id", description: "The unique identifier of chat") { }; chatIdOption.IsRequired = true; @@ -267,7 +267,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Send a new chatMessage in the specified channel or a chat. + /// Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message. /// /// A /// The request body diff --git a/src/generated/Communications/CallRecords/MicrosoftGraphCallRecordsGetDirectRoutingCallsWithFromDateTimeWithToDateTime/MicrosoftGraphCallRecordsGetDirectRoutingCallsWithFromDateTimeWithToDateTimeRequestBuilder.cs b/src/generated/Communications/CallRecords/MicrosoftGraphCallRecordsGetDirectRoutingCallsWithFromDateTimeWithToDateTime/MicrosoftGraphCallRecordsGetDirectRoutingCallsWithFromDateTimeWithToDateTimeRequestBuilder.cs index fa5c851c2e..bb2e12d803 100644 --- a/src/generated/Communications/CallRecords/MicrosoftGraphCallRecordsGetDirectRoutingCallsWithFromDateTimeWithToDateTime/MicrosoftGraphCallRecordsGetDirectRoutingCallsWithFromDateTimeWithToDateTimeRequestBuilder.cs +++ b/src/generated/Communications/CallRecords/MicrosoftGraphCallRecordsGetDirectRoutingCallsWithFromDateTimeWithToDateTime/MicrosoftGraphCallRecordsGetDirectRoutingCallsWithFromDateTimeWithToDateTimeRequestBuilder.cs @@ -28,11 +28,11 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get a log of direct routing calls as a collection of directRoutingLogRow entries."; - var fromDateTimeOption = new Option("--from-date-time", description: "Usage: fromDateTime={fromDateTime}") { + var fromDateTimeOption = new Option("--from-date-time", description: "Usage: fromDateTime={fromDateTime}") { }; fromDateTimeOption.IsRequired = true; command.AddOption(fromDateTimeOption); - var toDateTimeOption = new Option("--to-date-time", description: "Usage: toDateTime={toDateTime}") { + var toDateTimeOption = new Option("--to-date-time", description: "Usage: toDateTime={toDateTime}") { }; toDateTimeOption.IsRequired = true; command.AddOption(toDateTimeOption); diff --git a/src/generated/Communications/CallRecords/MicrosoftGraphCallRecordsGetPstnCallsWithFromDateTimeWithToDateTime/MicrosoftGraphCallRecordsGetPstnCallsWithFromDateTimeWithToDateTimeRequestBuilder.cs b/src/generated/Communications/CallRecords/MicrosoftGraphCallRecordsGetPstnCallsWithFromDateTimeWithToDateTime/MicrosoftGraphCallRecordsGetPstnCallsWithFromDateTimeWithToDateTimeRequestBuilder.cs index 6f6d957a79..ad722dd213 100644 --- a/src/generated/Communications/CallRecords/MicrosoftGraphCallRecordsGetPstnCallsWithFromDateTimeWithToDateTime/MicrosoftGraphCallRecordsGetPstnCallsWithFromDateTimeWithToDateTimeRequestBuilder.cs +++ b/src/generated/Communications/CallRecords/MicrosoftGraphCallRecordsGetPstnCallsWithFromDateTimeWithToDateTime/MicrosoftGraphCallRecordsGetPstnCallsWithFromDateTimeWithToDateTimeRequestBuilder.cs @@ -28,11 +28,11 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get log of PSTN calls as a collection of pstnCallLogRow entries."; - var fromDateTimeOption = new Option("--from-date-time", description: "Usage: fromDateTime={fromDateTime}") { + var fromDateTimeOption = new Option("--from-date-time", description: "Usage: fromDateTime={fromDateTime}") { }; fromDateTimeOption.IsRequired = true; command.AddOption(fromDateTimeOption); - var toDateTimeOption = new Option("--to-date-time", description: "Usage: toDateTime={toDateTime}") { + var toDateTimeOption = new Option("--to-date-time", description: "Usage: toDateTime={toDateTime}") { }; toDateTimeOption.IsRequired = true; command.AddOption(toDateTimeOption); diff --git a/src/generated/DeviceAppManagement/DeviceAppManagementRequestBuilder.cs b/src/generated/DeviceAppManagement/DeviceAppManagementRequestBuilder.cs index 3933fcd13d..f023bc15f4 100644 --- a/src/generated/DeviceAppManagement/DeviceAppManagementRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/DeviceAppManagementRequestBuilder.cs @@ -92,13 +92,13 @@ public Command BuildDefaultManagedAppProtectionsNavCommand() } /// /// Read properties and relationships of the deviceAppManagement object. - /// Find more info here + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the deviceAppManagement object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-policyset-deviceappmanagement-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the deviceAppManagement object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-deviceappmanagement-get?view=graph-rest-1.0"; var selectOption = new Option("--select", description: "Select properties to be returned") { Arity = ArgumentArity.ZeroOrMore }; @@ -399,13 +399,13 @@ public Command BuildMobileAppsNavCommand() } /// /// Update the properties of a deviceAppManagement object. - /// Find more info here + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the properties of a deviceAppManagement object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-deviceappmanagement-update?view=graph-rest-1.0"; + command.Description = "Update the properties of a deviceAppManagement object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceappmanagement-update?view=graph-rest-1.0"; var bodyOption = new Option("--body", description: "The request body") { }; bodyOption.IsRequired = true; diff --git a/src/generated/DeviceAppManagement/ManagedAppPolicies/ManagedAppPoliciesRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppPolicies/ManagedAppPoliciesRequestBuilder.cs index 497d5dded8..cd6ae34d26 100644 --- a/src/generated/DeviceAppManagement/ManagedAppPolicies/ManagedAppPoliciesRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppPolicies/ManagedAppPoliciesRequestBuilder.cs @@ -101,14 +101,14 @@ public Command BuildCreateCommand() return command; } /// - /// List properties and relationships of the managedAppProtection objects. - /// Find more info here + /// List properties and relationships of the managedAppPolicy objects. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List properties and relationships of the managedAppProtection objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-mam-managedappprotection-list?view=graph-rest-1.0"; + command.Description = "List properties and relationships of the managedAppPolicy objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-mam-managedapppolicy-list?view=graph-rest-1.0"; var topOption = new Option("--top", description: "Show only the first n items") { }; topOption.IsRequired = false; @@ -212,7 +212,7 @@ public ManagedAppPoliciesRequestBuilder(string rawUrl) : base("{+baseurl}/device { } /// - /// List properties and relationships of the managedAppProtection objects. + /// List properties and relationships of the managedAppPolicy objects. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -252,7 +252,7 @@ public RequestInformation ToPostRequestInformation(ManagedAppPolicy body, Action return requestInfo; } /// - /// List properties and relationships of the managedAppProtection objects. + /// List properties and relationships of the managedAppPolicy objects. /// public class ManagedAppPoliciesRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/ManagedAppRegistrationItemRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/ManagedAppRegistrationItemRequestBuilder.cs index d7b00da392..924e65e8ef 100644 --- a/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/ManagedAppRegistrationItemRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedAppRegistrations/Item/ManagedAppRegistrationItemRequestBuilder.cs @@ -87,14 +87,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Read properties and relationships of the androidManagedAppRegistration object. - /// Find more info here + /// Read properties and relationships of the iosManagedAppRegistration object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the androidManagedAppRegistration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-mam-androidmanagedappregistration-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the iosManagedAppRegistration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-mam-iosmanagedappregistration-get?view=graph-rest-1.0"; var managedAppRegistrationIdOption = new Option("--managed-app-registration-id", description: "The unique identifier of managedAppRegistration") { }; managedAppRegistrationIdOption.IsRequired = true; @@ -278,7 +278,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the androidManagedAppRegistration object. + /// Read properties and relationships of the iosManagedAppRegistration object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -318,7 +318,7 @@ public RequestInformation ToPatchRequestInformation(ManagedAppRegistration body, return requestInfo; } /// - /// Read properties and relationships of the androidManagedAppRegistration object. + /// Read properties and relationships of the iosManagedAppRegistration object. /// public class ManagedAppRegistrationItemRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/AssignmentsRequestBuilder.cs index e3ce57aaf3..3d24959817 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/AssignmentsRequestBuilder.cs @@ -54,14 +54,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Create a new managedEBookAssignment object. - /// Find more info here + /// Create a new iosVppEBookAssignment object. + /// Find more info here /// /// A public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create a new managedEBookAssignment object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-managedebookassignment-create?view=graph-rest-1.0"; + command.Description = "Create a new iosVppEBookAssignment object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-iosvppebookassignment-create?view=graph-rest-1.0"; var managedEBookIdOption = new Option("--managed-ebook-id", description: "The unique identifier of managedEBook") { }; managedEBookIdOption.IsRequired = true; @@ -106,14 +106,14 @@ public Command BuildCreateCommand() return command; } /// - /// List properties and relationships of the iosVppEBookAssignment objects. - /// Find more info here + /// List properties and relationships of the managedEBookAssignment objects. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List properties and relationships of the iosVppEBookAssignment objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-iosvppebookassignment-list?view=graph-rest-1.0"; + command.Description = "List properties and relationships of the managedEBookAssignment objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-managedebookassignment-list?view=graph-rest-1.0"; var managedEBookIdOption = new Option("--managed-ebook-id", description: "The unique identifier of managedEBook") { }; managedEBookIdOption.IsRequired = true; @@ -223,7 +223,7 @@ public AssignmentsRequestBuilder(string rawUrl) : base("{+baseurl}/deviceAppMana { } /// - /// List properties and relationships of the iosVppEBookAssignment objects. + /// List properties and relationships of the managedEBookAssignment objects. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -242,7 +242,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Create a new managedEBookAssignment object. + /// Create a new iosVppEBookAssignment object. /// /// A /// The request body @@ -263,7 +263,7 @@ public RequestInformation ToPostRequestInformation(ManagedEBookAssignment body, return requestInfo; } /// - /// List properties and relationships of the iosVppEBookAssignment objects. + /// List properties and relationships of the managedEBookAssignment objects. /// public class AssignmentsRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/Item/ManagedEBookAssignmentItemRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/Item/ManagedEBookAssignmentItemRequestBuilder.cs index 3c6126b124..716f87ad75 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/Item/ManagedEBookAssignmentItemRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/Assignments/Item/ManagedEBookAssignmentItemRequestBuilder.cs @@ -22,14 +22,14 @@ namespace ApiSdk.DeviceAppManagement.ManagedEBooks.Item.Assignments.Item public class ManagedEBookAssignmentItemRequestBuilder : BaseCliRequestBuilder { /// - /// Deletes a iosVppEBookAssignment. - /// Find more info here + /// Deletes a managedEBookAssignment. + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Deletes a iosVppEBookAssignment.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-iosvppebookassignment-delete?view=graph-rest-1.0"; + command.Description = "Deletes a managedEBookAssignment.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-managedebookassignment-delete?view=graph-rest-1.0"; var managedEBookIdOption = new Option("--managed-ebook-id", description: "The unique identifier of managedEBook") { }; managedEBookIdOption.IsRequired = true; @@ -64,14 +64,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Read properties and relationships of the managedEBookAssignment object. - /// Find more info here + /// Read properties and relationships of the iosVppEBookAssignment object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the managedEBookAssignment object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-managedebookassignment-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the iosVppEBookAssignment object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-iosvppebookassignment-get?view=graph-rest-1.0"; var managedEBookIdOption = new Option("--managed-ebook-id", description: "The unique identifier of managedEBook") { }; managedEBookIdOption.IsRequired = true; @@ -195,7 +195,7 @@ public ManagedEBookAssignmentItemRequestBuilder(string rawUrl) : base("{+baseurl { } /// - /// Deletes a iosVppEBookAssignment. + /// Deletes a managedEBookAssignment. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -214,7 +214,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the managedEBookAssignment object. + /// Read properties and relationships of the iosVppEBookAssignment object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -254,7 +254,7 @@ public RequestInformation ToPatchRequestInformation(ManagedEBookAssignment body, return requestInfo; } /// - /// Read properties and relationships of the managedEBookAssignment object. + /// Read properties and relationships of the iosVppEBookAssignment object. /// public class ManagedEBookAssignmentItemRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceAppManagement/ManagedEBooks/Item/ManagedEBookItemRequestBuilder.cs b/src/generated/DeviceAppManagement/ManagedEBooks/Item/ManagedEBookItemRequestBuilder.cs index cff7d28469..b0aff8208d 100644 --- a/src/generated/DeviceAppManagement/ManagedEBooks/Item/ManagedEBookItemRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/ManagedEBooks/Item/ManagedEBookItemRequestBuilder.cs @@ -134,14 +134,14 @@ public Command BuildDeviceStatesNavCommand() return command; } /// - /// Read properties and relationships of the managedEBook object. - /// Find more info here + /// Read properties and relationships of the iosVppEBook object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the managedEBook object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-managedebook-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the iosVppEBook object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-books-iosvppebook-get?view=graph-rest-1.0"; var managedEBookIdOption = new Option("--managed-ebook-id", description: "The unique identifier of managedEBook") { }; managedEBookIdOption.IsRequired = true; @@ -318,7 +318,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the managedEBook object. + /// Read properties and relationships of the iosVppEBook object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -358,7 +358,7 @@ public RequestInformation ToPatchRequestInformation(ManagedEBook body, Action - /// Read properties and relationships of the managedEBook object. + /// Read properties and relationships of the iosVppEBook object. /// public class ManagedEBookItemRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/ManagedDeviceMobileAppConfigurationItemRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/ManagedDeviceMobileAppConfigurationItemRequestBuilder.cs index e3ea827271..103ffe1421 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/ManagedDeviceMobileAppConfigurationItemRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/Item/ManagedDeviceMobileAppConfigurationItemRequestBuilder.cs @@ -154,14 +154,14 @@ public Command BuildDeviceStatusSummaryNavCommand() return command; } /// - /// Read properties and relationships of the iosMobileAppConfiguration object. - /// Find more info here + /// Read properties and relationships of the managedDeviceMobileAppConfiguration object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the iosMobileAppConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-iosmobileappconfiguration-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the managedDeviceMobileAppConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-manageddevicemobileappconfiguration-get?view=graph-rest-1.0"; var managedDeviceMobileAppConfigurationIdOption = new Option("--managed-device-mobile-app-configuration-id", description: "The unique identifier of managedDeviceMobileAppConfiguration") { }; managedDeviceMobileAppConfigurationIdOption.IsRequired = true; @@ -338,7 +338,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the iosMobileAppConfiguration object. + /// Read properties and relationships of the managedDeviceMobileAppConfiguration object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -378,7 +378,7 @@ public RequestInformation ToPatchRequestInformation(ManagedDeviceMobileAppConfig return requestInfo; } /// - /// Read properties and relationships of the iosMobileAppConfiguration object. + /// Read properties and relationships of the managedDeviceMobileAppConfiguration object. /// public class ManagedDeviceMobileAppConfigurationItemRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceAppManagement/MobileAppConfigurations/MobileAppConfigurationsRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileAppConfigurations/MobileAppConfigurationsRequestBuilder.cs index 924f5c1e72..64f9319dd3 100644 --- a/src/generated/DeviceAppManagement/MobileAppConfigurations/MobileAppConfigurationsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileAppConfigurations/MobileAppConfigurationsRequestBuilder.cs @@ -107,14 +107,14 @@ public Command BuildCreateCommand() return command; } /// - /// List properties and relationships of the managedDeviceMobileAppConfiguration objects. - /// Find more info here + /// List properties and relationships of the iosMobileAppConfiguration objects. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List properties and relationships of the managedDeviceMobileAppConfiguration objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-manageddevicemobileappconfiguration-list?view=graph-rest-1.0"; + command.Description = "List properties and relationships of the iosMobileAppConfiguration objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-iosmobileappconfiguration-list?view=graph-rest-1.0"; var topOption = new Option("--top", description: "Show only the first n items") { }; topOption.IsRequired = false; @@ -218,7 +218,7 @@ public MobileAppConfigurationsRequestBuilder(string rawUrl) : base("{+baseurl}/d { } /// - /// List properties and relationships of the managedDeviceMobileAppConfiguration objects. + /// List properties and relationships of the iosMobileAppConfiguration objects. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -258,7 +258,7 @@ public RequestInformation ToPostRequestInformation(ManagedDeviceMobileAppConfigu return requestInfo; } /// - /// List properties and relationships of the managedDeviceMobileAppConfiguration objects. + /// List properties and relationships of the iosMobileAppConfiguration objects. /// public class MobileAppConfigurationsRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceAppManagement/MobileApps/Item/MobileAppItemRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileApps/Item/MobileAppItemRequestBuilder.cs index 57b1f9e57c..d949b3743a 100644 --- a/src/generated/DeviceAppManagement/MobileApps/Item/MobileAppItemRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileApps/Item/MobileAppItemRequestBuilder.cs @@ -111,14 +111,14 @@ public Command BuildCategoriesNavCommand() return command; } /// - /// Deletes a windowsMicrosoftEdgeApp. - /// Find more info here + /// Deletes a iosLobApp. + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Deletes a windowsMicrosoftEdgeApp.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-windowsmicrosoftedgeapp-delete?view=graph-rest-1.0"; + command.Description = "Deletes a iosLobApp.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-ioslobapp-delete?view=graph-rest-1.0"; var mobileAppIdOption = new Option("--mobile-app-id", description: "The unique identifier of mobileApp") { }; mobileAppIdOption.IsRequired = true; @@ -147,14 +147,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Read properties and relationships of the macOSOfficeSuiteApp object. - /// Find more info here + /// Read properties and relationships of the windowsUniversalAppX object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the macOSOfficeSuiteApp object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-macosofficesuiteapp-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the windowsUniversalAppX object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-windowsuniversalappx-get?view=graph-rest-1.0"; var mobileAppIdOption = new Option("--mobile-app-id", description: "The unique identifier of mobileApp") { }; mobileAppIdOption.IsRequired = true; @@ -596,14 +596,14 @@ public Command BuildGraphWindowsWebAppByIdNavCommand() return command; } /// - /// Update the properties of a iosStoreApp object. - /// Find more info here + /// Update the properties of a windowsMicrosoftEdgeApp object. + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the properties of a iosStoreApp object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-iosstoreapp-update?view=graph-rest-1.0"; + command.Description = "Update the properties of a windowsMicrosoftEdgeApp object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-windowsmicrosoftedgeapp-update?view=graph-rest-1.0"; var mobileAppIdOption = new Option("--mobile-app-id", description: "The unique identifier of mobileApp") { }; mobileAppIdOption.IsRequired = true; @@ -662,7 +662,7 @@ public MobileAppItemRequestBuilder(string rawUrl) : base("{+baseurl}/deviceAppMa { } /// - /// Deletes a windowsMicrosoftEdgeApp. + /// Deletes a iosLobApp. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -681,7 +681,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the macOSOfficeSuiteApp object. + /// Read properties and relationships of the windowsUniversalAppX object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -700,7 +700,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Update the properties of a iosStoreApp object. + /// Update the properties of a windowsMicrosoftEdgeApp object. /// /// A /// The request body @@ -721,7 +721,7 @@ public RequestInformation ToPatchRequestInformation(MobileApp body, Action - /// Read properties and relationships of the macOSOfficeSuiteApp object. + /// Read properties and relationships of the windowsUniversalAppX object. /// public class MobileAppItemRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceAppManagement/MobileApps/MobileAppsRequestBuilder.cs b/src/generated/DeviceAppManagement/MobileApps/MobileAppsRequestBuilder.cs index 5db102147c..add2c4f21f 100644 --- a/src/generated/DeviceAppManagement/MobileApps/MobileAppsRequestBuilder.cs +++ b/src/generated/DeviceAppManagement/MobileApps/MobileAppsRequestBuilder.cs @@ -90,14 +90,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Create a new macOSOfficeSuiteApp object. - /// Find more info here + /// Create a new iosLobApp object. + /// Find more info here /// /// A public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create a new macOSOfficeSuiteApp object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-macosofficesuiteapp-create?view=graph-rest-1.0"; + command.Description = "Create a new iosLobApp object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-ioslobapp-create?view=graph-rest-1.0"; var bodyOption = new Option("--body", description: "The request body") { }; bodyOption.IsRequired = true; @@ -504,14 +504,14 @@ public Command BuildGraphWindowsWebAppNavCommand() return command; } /// - /// List properties and relationships of the windowsMobileMSI objects. - /// Find more info here + /// List properties and relationships of the macOSLobApp objects. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List properties and relationships of the windowsMobileMSI objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-windowsmobilemsi-list?view=graph-rest-1.0"; + command.Description = "List properties and relationships of the macOSLobApp objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-apps-macoslobapp-list?view=graph-rest-1.0"; var topOption = new Option("--top", description: "Show only the first n items") { }; topOption.IsRequired = false; @@ -615,7 +615,7 @@ public MobileAppsRequestBuilder(string rawUrl) : base("{+baseurl}/deviceAppManag { } /// - /// List properties and relationships of the windowsMobileMSI objects. + /// List properties and relationships of the macOSLobApp objects. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -634,7 +634,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Create a new macOSOfficeSuiteApp object. + /// Create a new iosLobApp object. /// /// A /// The request body @@ -655,7 +655,7 @@ public RequestInformation ToPostRequestInformation(MobileApp body, Action - /// List properties and relationships of the windowsMobileMSI objects. + /// List properties and relationships of the macOSLobApp objects. /// public class MobileAppsRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/DeviceCompliancePoliciesRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/DeviceCompliancePoliciesRequestBuilder.cs index 4333229664..def47c504d 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/DeviceCompliancePoliciesRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/DeviceCompliancePoliciesRequestBuilder.cs @@ -64,14 +64,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Create a new windows10MobileCompliancePolicy object. - /// Find more info here + /// Create a new windows81CompliancePolicy object. + /// Find more info here /// /// A public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create a new windows10MobileCompliancePolicy object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windows10mobilecompliancepolicy-create?view=graph-rest-1.0"; + command.Description = "Create a new windows81CompliancePolicy object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windows81compliancepolicy-create?view=graph-rest-1.0"; var bodyOption = new Option("--body", description: "The request body") { }; bodyOption.IsRequired = true; @@ -110,14 +110,14 @@ public Command BuildCreateCommand() return command; } /// - /// List properties and relationships of the macOSCompliancePolicy objects. - /// Find more info here + /// List properties and relationships of the windows81CompliancePolicy objects. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List properties and relationships of the macOSCompliancePolicy objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-macoscompliancepolicy-list?view=graph-rest-1.0"; + command.Description = "List properties and relationships of the windows81CompliancePolicy objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windows81compliancepolicy-list?view=graph-rest-1.0"; var topOption = new Option("--top", description: "Show only the first n items") { }; topOption.IsRequired = false; @@ -221,7 +221,7 @@ public DeviceCompliancePoliciesRequestBuilder(string rawUrl) : base("{+baseurl}/ { } /// - /// List properties and relationships of the macOSCompliancePolicy objects. + /// List properties and relationships of the windows81CompliancePolicy objects. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -240,7 +240,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Create a new windows10MobileCompliancePolicy object. + /// Create a new windows81CompliancePolicy object. /// /// A /// The request body @@ -261,7 +261,7 @@ public RequestInformation ToPostRequestInformation(DeviceCompliancePolicy body, return requestInfo; } /// - /// List properties and relationships of the macOSCompliancePolicy objects. + /// List properties and relationships of the windows81CompliancePolicy objects. /// public class DeviceCompliancePoliciesRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceCompliancePolicyItemRequestBuilder.cs b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceCompliancePolicyItemRequestBuilder.cs index 99acf01f72..8c8dc47746 100644 --- a/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceCompliancePolicyItemRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceCompliancePolicies/Item/DeviceCompliancePolicyItemRequestBuilder.cs @@ -75,14 +75,14 @@ public Command BuildAssignNavCommand() return command; } /// - /// Deletes a iosCompliancePolicy. - /// Find more info here + /// Deletes a windows10MobileCompliancePolicy. + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Deletes a iosCompliancePolicy.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-ioscompliancepolicy-delete?view=graph-rest-1.0"; + command.Description = "Deletes a windows10MobileCompliancePolicy.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windows10mobilecompliancepolicy-delete?view=graph-rest-1.0"; var deviceCompliancePolicyIdOption = new Option("--device-compliance-policy-id", description: "The unique identifier of deviceCompliancePolicy") { }; deviceCompliancePolicyIdOption.IsRequired = true; @@ -184,14 +184,14 @@ public Command BuildDeviceStatusOverviewNavCommand() return command; } /// - /// Read properties and relationships of the windows81CompliancePolicy object. - /// Find more info here + /// Read properties and relationships of the androidWorkProfileCompliancePolicy object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the windows81CompliancePolicy object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windows81compliancepolicy-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the androidWorkProfileCompliancePolicy object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-androidworkprofilecompliancepolicy-get?view=graph-rest-1.0"; var deviceCompliancePolicyIdOption = new Option("--device-compliance-policy-id", description: "The unique identifier of deviceCompliancePolicy") { }; deviceCompliancePolicyIdOption.IsRequired = true; @@ -237,14 +237,14 @@ public Command BuildGetCommand() return command; } /// - /// Update the properties of a androidWorkProfileCompliancePolicy object. - /// Find more info here + /// Update the properties of a windows10MobileCompliancePolicy object. + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the properties of a androidWorkProfileCompliancePolicy object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-androidworkprofilecompliancepolicy-update?view=graph-rest-1.0"; + command.Description = "Update the properties of a windows10MobileCompliancePolicy object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windows10mobilecompliancepolicy-update?view=graph-rest-1.0"; var deviceCompliancePolicyIdOption = new Option("--device-compliance-policy-id", description: "The unique identifier of deviceCompliancePolicy") { }; deviceCompliancePolicyIdOption.IsRequired = true; @@ -393,7 +393,7 @@ public DeviceCompliancePolicyItemRequestBuilder(string rawUrl) : base("{+baseurl { } /// - /// Deletes a iosCompliancePolicy. + /// Deletes a windows10MobileCompliancePolicy. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -412,7 +412,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the windows81CompliancePolicy object. + /// Read properties and relationships of the androidWorkProfileCompliancePolicy object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -431,7 +431,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Update the properties of a androidWorkProfileCompliancePolicy object. + /// Update the properties of a windows10MobileCompliancePolicy object. /// /// A /// The request body @@ -452,7 +452,7 @@ public RequestInformation ToPatchRequestInformation(DeviceCompliancePolicy body, return requestInfo; } /// - /// Read properties and relationships of the windows81CompliancePolicy object. + /// Read properties and relationships of the androidWorkProfileCompliancePolicy object. /// public class DeviceCompliancePolicyItemRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceManagement/DeviceConfigurations/DeviceConfigurationsRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/DeviceConfigurationsRequestBuilder.cs index b3e23a71ba..924a8ab599 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/DeviceConfigurationsRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/DeviceConfigurationsRequestBuilder.cs @@ -63,14 +63,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Create a new windows10CustomConfiguration object. - /// Find more info here + /// Create a new windowsPhone81GeneralConfiguration object. + /// Find more info here /// /// A public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create a new windows10CustomConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windows10customconfiguration-create?view=graph-rest-1.0"; + command.Description = "Create a new windowsPhone81GeneralConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windowsphone81generalconfiguration-create?view=graph-rest-1.0"; var bodyOption = new Option("--body", description: "The request body") { }; bodyOption.IsRequired = true; @@ -109,14 +109,14 @@ public Command BuildCreateCommand() return command; } /// - /// List properties and relationships of the macOSGeneralDeviceConfiguration objects. - /// Find more info here + /// List properties and relationships of the macOSDeviceFeaturesConfiguration objects. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List properties and relationships of the macOSGeneralDeviceConfiguration objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-macosgeneraldeviceconfiguration-list?view=graph-rest-1.0"; + command.Description = "List properties and relationships of the macOSDeviceFeaturesConfiguration objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-macosdevicefeaturesconfiguration-list?view=graph-rest-1.0"; var topOption = new Option("--top", description: "Show only the first n items") { }; topOption.IsRequired = false; @@ -220,7 +220,7 @@ public DeviceConfigurationsRequestBuilder(string rawUrl) : base("{+baseurl}/devi { } /// - /// List properties and relationships of the macOSGeneralDeviceConfiguration objects. + /// List properties and relationships of the macOSDeviceFeaturesConfiguration objects. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -239,7 +239,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Create a new windows10CustomConfiguration object. + /// Create a new windowsPhone81GeneralConfiguration object. /// /// A /// The request body @@ -260,7 +260,7 @@ public RequestInformation ToPostRequestInformation(DeviceConfiguration body, Act return requestInfo; } /// - /// List properties and relationships of the macOSGeneralDeviceConfiguration objects. + /// List properties and relationships of the macOSDeviceFeaturesConfiguration objects. /// public class DeviceConfigurationsRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceConfigurationItemRequestBuilder.cs b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceConfigurationItemRequestBuilder.cs index fc28269cc5..939b43723a 100644 --- a/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceConfigurationItemRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceConfigurations/Item/DeviceConfigurationItemRequestBuilder.cs @@ -74,14 +74,14 @@ public Command BuildAssignNavCommand() return command; } /// - /// Deletes a iosDeviceFeaturesConfiguration. - /// Find more info here + /// Deletes a iosCustomConfiguration. + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Deletes a iosDeviceFeaturesConfiguration.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-iosdevicefeaturesconfiguration-delete?view=graph-rest-1.0"; + command.Description = "Deletes a iosCustomConfiguration.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-ioscustomconfiguration-delete?view=graph-rest-1.0"; var deviceConfigurationIdOption = new Option("--device-configuration-id", description: "The unique identifier of deviceConfiguration") { }; deviceConfigurationIdOption.IsRequired = true; @@ -183,14 +183,14 @@ public Command BuildDeviceStatusOverviewNavCommand() return command; } /// - /// Read properties and relationships of the androidCustomConfiguration object. - /// Find more info here + /// Read properties and relationships of the windows10GeneralConfiguration object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the androidCustomConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-androidcustomconfiguration-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the windows10GeneralConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windows10generalconfiguration-get?view=graph-rest-1.0"; var deviceConfigurationIdOption = new Option("--device-configuration-id", description: "The unique identifier of deviceConfiguration") { }; deviceConfigurationIdOption.IsRequired = true; @@ -253,14 +253,14 @@ public Command BuildGetOmaSettingPlainTextValueWithSecretReferenceValueIdRbComma return command; } /// - /// Update the properties of a androidWorkProfileCustomConfiguration object. - /// Find more info here + /// Update the properties of a windowsDefenderAdvancedThreatProtectionConfiguration object. + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the properties of a androidWorkProfileCustomConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-androidworkprofilecustomconfiguration-update?view=graph-rest-1.0"; + command.Description = "Update the properties of a windowsDefenderAdvancedThreatProtectionConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-deviceconfig-windowsdefenderadvancedthreatprotectionconfiguration-update?view=graph-rest-1.0"; var deviceConfigurationIdOption = new Option("--device-configuration-id", description: "The unique identifier of deviceConfiguration") { }; deviceConfigurationIdOption.IsRequired = true; @@ -365,7 +365,7 @@ public DeviceConfigurationItemRequestBuilder(string rawUrl) : base("{+baseurl}/d { } /// - /// Deletes a iosDeviceFeaturesConfiguration. + /// Deletes a iosCustomConfiguration. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -384,7 +384,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the androidCustomConfiguration object. + /// Read properties and relationships of the windows10GeneralConfiguration object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -403,7 +403,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Update the properties of a androidWorkProfileCustomConfiguration object. + /// Update the properties of a windowsDefenderAdvancedThreatProtectionConfiguration object. /// /// A /// The request body @@ -424,7 +424,7 @@ public RequestInformation ToPatchRequestInformation(DeviceConfiguration body, Ac return requestInfo; } /// - /// Read properties and relationships of the androidCustomConfiguration object. + /// Read properties and relationships of the windows10GeneralConfiguration object. /// public class DeviceConfigurationItemRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/DeviceEnrollmentConfigurationsRequestBuilder.cs b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/DeviceEnrollmentConfigurationsRequestBuilder.cs index 7cdd09f53c..c0a78a84b8 100644 --- a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/DeviceEnrollmentConfigurationsRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/DeviceEnrollmentConfigurationsRequestBuilder.cs @@ -58,14 +58,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Create a new deviceEnrollmentLimitConfiguration object. - /// Find more info here + /// Create a new deviceEnrollmentPlatformRestrictionsConfiguration object. + /// Find more info here /// /// A public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create a new deviceEnrollmentLimitConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentlimitconfiguration-create?view=graph-rest-1.0"; + command.Description = "Create a new deviceEnrollmentPlatformRestrictionsConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentplatformrestrictionsconfiguration-create?view=graph-rest-1.0"; var bodyOption = new Option("--body", description: "The request body") { }; bodyOption.IsRequired = true; @@ -104,14 +104,14 @@ public Command BuildCreateCommand() return command; } /// - /// List properties and relationships of the deviceEnrollmentPlatformRestrictionsConfiguration objects. - /// Find more info here + /// List properties and relationships of the deviceEnrollmentLimitConfiguration objects. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List properties and relationships of the deviceEnrollmentPlatformRestrictionsConfiguration objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentplatformrestrictionsconfiguration-list?view=graph-rest-1.0"; + command.Description = "List properties and relationships of the deviceEnrollmentLimitConfiguration objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentlimitconfiguration-list?view=graph-rest-1.0"; var topOption = new Option("--top", description: "Show only the first n items") { }; topOption.IsRequired = false; @@ -215,7 +215,7 @@ public DeviceEnrollmentConfigurationsRequestBuilder(string rawUrl) : base("{+bas { } /// - /// List properties and relationships of the deviceEnrollmentPlatformRestrictionsConfiguration objects. + /// List properties and relationships of the deviceEnrollmentLimitConfiguration objects. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -234,7 +234,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Create a new deviceEnrollmentLimitConfiguration object. + /// Create a new deviceEnrollmentPlatformRestrictionsConfiguration object. /// /// A /// The request body @@ -255,7 +255,7 @@ public RequestInformation ToPostRequestInformation(DeviceEnrollmentConfiguration return requestInfo; } /// - /// List properties and relationships of the deviceEnrollmentPlatformRestrictionsConfiguration objects. + /// List properties and relationships of the deviceEnrollmentLimitConfiguration objects. /// public class DeviceEnrollmentConfigurationsRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/DeviceEnrollmentConfigurationItemRequestBuilder.cs b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/DeviceEnrollmentConfigurationItemRequestBuilder.cs index da1074a1d4..8eab6a3473 100644 --- a/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/DeviceEnrollmentConfigurationItemRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceEnrollmentConfigurations/Item/DeviceEnrollmentConfigurationItemRequestBuilder.cs @@ -69,14 +69,14 @@ public Command BuildAssignNavCommand() return command; } /// - /// Deletes a deviceEnrollmentWindowsHelloForBusinessConfiguration. - /// Find more info here + /// Deletes a deviceEnrollmentPlatformRestrictionsConfiguration. + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Deletes a deviceEnrollmentWindowsHelloForBusinessConfiguration.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentwindowshelloforbusinessconfiguration-delete?view=graph-rest-1.0"; + command.Description = "Deletes a deviceEnrollmentPlatformRestrictionsConfiguration.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentplatformrestrictionsconfiguration-delete?view=graph-rest-1.0"; var deviceEnrollmentConfigurationIdOption = new Option("--device-enrollment-configuration-id", description: "The unique identifier of deviceEnrollmentConfiguration") { }; deviceEnrollmentConfigurationIdOption.IsRequired = true; @@ -105,14 +105,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Read properties and relationships of the deviceEnrollmentWindowsHelloForBusinessConfiguration object. - /// Find more info here + /// Read properties and relationships of the deviceEnrollmentLimitConfiguration object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the deviceEnrollmentWindowsHelloForBusinessConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentwindowshelloforbusinessconfiguration-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the deviceEnrollmentLimitConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentlimitconfiguration-get?view=graph-rest-1.0"; var deviceEnrollmentConfigurationIdOption = new Option("--device-enrollment-configuration-id", description: "The unique identifier of deviceEnrollmentConfiguration") { }; deviceEnrollmentConfigurationIdOption.IsRequired = true; @@ -158,14 +158,14 @@ public Command BuildGetCommand() return command; } /// - /// Update the properties of a deviceEnrollmentLimitConfiguration object. - /// Find more info here + /// Update the properties of a deviceEnrollmentPlatformRestrictionsConfiguration object. + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the properties of a deviceEnrollmentLimitConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentlimitconfiguration-update?view=graph-rest-1.0"; + command.Description = "Update the properties of a deviceEnrollmentPlatformRestrictionsConfiguration object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-deviceenrollmentplatformrestrictionsconfiguration-update?view=graph-rest-1.0"; var deviceEnrollmentConfigurationIdOption = new Option("--device-enrollment-configuration-id", description: "The unique identifier of deviceEnrollmentConfiguration") { }; deviceEnrollmentConfigurationIdOption.IsRequired = true; @@ -241,7 +241,7 @@ public DeviceEnrollmentConfigurationItemRequestBuilder(string rawUrl) : base("{+ { } /// - /// Deletes a deviceEnrollmentWindowsHelloForBusinessConfiguration. + /// Deletes a deviceEnrollmentPlatformRestrictionsConfiguration. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -260,7 +260,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the deviceEnrollmentWindowsHelloForBusinessConfiguration object. + /// Read properties and relationships of the deviceEnrollmentLimitConfiguration object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -279,7 +279,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Update the properties of a deviceEnrollmentLimitConfiguration object. + /// Update the properties of a deviceEnrollmentPlatformRestrictionsConfiguration object. /// /// A /// The request body @@ -300,7 +300,7 @@ public RequestInformation ToPatchRequestInformation(DeviceEnrollmentConfiguratio return requestInfo; } /// - /// Read properties and relationships of the deviceEnrollmentWindowsHelloForBusinessConfiguration object. + /// Read properties and relationships of the deviceEnrollmentLimitConfiguration object. /// public class DeviceEnrollmentConfigurationItemRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceManagement/DeviceManagementRequestBuilder.cs b/src/generated/DeviceManagement/DeviceManagementRequestBuilder.cs index 8f03686718..4651cc6de0 100644 --- a/src/generated/DeviceManagement/DeviceManagementRequestBuilder.cs +++ b/src/generated/DeviceManagement/DeviceManagementRequestBuilder.cs @@ -438,13 +438,13 @@ public Command BuildExchangeConnectorsNavCommand() } /// /// Read properties and relationships of the deviceManagement object. - /// Find more info here + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the deviceManagement object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-remoteassistance-devicemanagement-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the deviceManagement object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-gpanalyticsservice-devicemanagement-get?view=graph-rest-1.0"; var selectOption = new Option("--select", description: "Select properties to be returned") { Arity = ArgumentArity.ZeroOrMore }; @@ -682,13 +682,13 @@ public Command BuildNotificationMessageTemplatesNavCommand() } /// /// Update the properties of a deviceManagement object. - /// Find more info here + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the properties of a deviceManagement object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-devicemanagement-update?view=graph-rest-1.0"; + command.Description = "Update the properties of a deviceManagement object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-rbac-devicemanagement-update?view=graph-rest-1.0"; var bodyOption = new Option("--body", description: "The request body") { }; bodyOption.IsRequired = true; diff --git a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleDefinitionItemRequestBuilder.cs b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleDefinitionItemRequestBuilder.cs index 2c36b547ac..2830bf6c92 100644 --- a/src/generated/DeviceManagement/RoleDefinitions/Item/RoleDefinitionItemRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleDefinitions/Item/RoleDefinitionItemRequestBuilder.cs @@ -59,14 +59,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Read properties and relationships of the deviceAndAppManagementRoleDefinition object. - /// Find more info here + /// Read properties and relationships of the roleDefinition object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the deviceAndAppManagementRoleDefinition object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-rbac-deviceandappmanagementroledefinition-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the roleDefinition object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-rbac-roledefinition-get?view=graph-rest-1.0"; var roleDefinitionIdOption = new Option("--role-definition-id", description: "The unique identifier of roleDefinition") { }; roleDefinitionIdOption.IsRequired = true; @@ -224,7 +224,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the deviceAndAppManagementRoleDefinition object. + /// Read properties and relationships of the roleDefinition object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -264,7 +264,7 @@ public RequestInformation ToPatchRequestInformation(ApiSdk.Models.RoleDefinition return requestInfo; } /// - /// Read properties and relationships of the deviceAndAppManagementRoleDefinition object. + /// Read properties and relationships of the roleDefinition object. /// public class RoleDefinitionItemRequestBuilderGetQueryParameters { diff --git a/src/generated/DeviceManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs b/src/generated/DeviceManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs index 5259428952..7ac24bd916 100644 --- a/src/generated/DeviceManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs +++ b/src/generated/DeviceManagement/RoleDefinitions/RoleDefinitionsRequestBuilder.cs @@ -102,14 +102,14 @@ public Command BuildCreateCommand() return command; } /// - /// List properties and relationships of the roleDefinition objects. - /// Find more info here + /// List properties and relationships of the deviceAndAppManagementRoleDefinition objects. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List properties and relationships of the roleDefinition objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-rbac-roledefinition-list?view=graph-rest-1.0"; + command.Description = "List properties and relationships of the deviceAndAppManagementRoleDefinition objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-rbac-deviceandappmanagementroledefinition-list?view=graph-rest-1.0"; var topOption = new Option("--top", description: "Show only the first n items") { }; topOption.IsRequired = false; @@ -213,7 +213,7 @@ public RoleDefinitionsRequestBuilder(string rawUrl) : base("{+baseurl}/deviceMan { } /// - /// List properties and relationships of the roleDefinition objects. + /// List properties and relationships of the deviceAndAppManagementRoleDefinition objects. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -253,7 +253,7 @@ public RequestInformation ToPostRequestInformation(ApiSdk.Models.RoleDefinition return requestInfo; } /// - /// List properties and relationships of the roleDefinition objects. + /// List properties and relationships of the deviceAndAppManagementRoleDefinition objects. /// public class RoleDefinitionsRequestBuilderGetQueryParameters { diff --git a/src/generated/Drives/Item/Items/Item/RetentionLabel/RetentionLabelRequestBuilder.cs b/src/generated/Drives/Item/Items/Item/RetentionLabel/RetentionLabelRequestBuilder.cs index a78e50ea55..28828eb035 100644 --- a/src/generated/Drives/Item/Items/Item/RetentionLabel/RetentionLabelRequestBuilder.cs +++ b/src/generated/Drives/Item/Items/Item/RetentionLabel/RetentionLabelRequestBuilder.cs @@ -122,14 +122,14 @@ public Command BuildGetCommand() return command; } /// - /// Lock or unlock a retention label on a driveItem that classifies content as records. For information about retention labels from an administrator's perspective, see Use retention labels to manage the lifecycle of documents stored in SharePoint. For more information about how you can lock and unlock retention labels, see Use record versioning to update records stored in SharePoint or OneDrive. - /// Find more info here + /// Apply (set) a retention label on a driveItem (files and folders). Retention labels don't need to be published in a retention label policy to be applied using this method. When a retention label is applied to a folder, all the items in the folder are tagged with the same retention label. For information about conflict resolution for retention labels, see Will an existing label be overridden or removed. For information about retention labels from an administrator's perspective, see Use retention labels to manage the lifecycle of documents stored in SharePoint. + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Lock or unlock a retention label on a driveItem that classifies content as records. For information about retention labels from an administrator's perspective, see Use retention labels to manage the lifecycle of documents stored in SharePoint. For more information about how you can lock and unlock retention labels, see Use record versioning to update records stored in SharePoint or OneDrive.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-lockorunlockrecord?view=graph-rest-1.0"; + command.Description = "Apply (set) a retention label on a driveItem (files and folders). Retention labels don't need to be published in a retention label policy to be applied using this method. When a retention label is applied to a folder, all the items in the folder are tagged with the same retention label. For information about conflict resolution for retention labels, see Will an existing label be overridden or removed. For information about retention labels from an administrator's perspective, see Use retention labels to manage the lifecycle of documents stored in SharePoint.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-setretentionlabel?view=graph-rest-1.0"; var driveIdOption = new Option("--drive-id", description: "The unique identifier of drive") { }; driveIdOption.IsRequired = true; @@ -232,7 +232,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Lock or unlock a retention label on a driveItem that classifies content as records. For information about retention labels from an administrator's perspective, see Use retention labels to manage the lifecycle of documents stored in SharePoint. For more information about how you can lock and unlock retention labels, see Use record versioning to update records stored in SharePoint or OneDrive. + /// Apply (set) a retention label on a driveItem (files and folders). Retention labels don't need to be published in a retention label policy to be applied using this method. When a retention label is applied to a folder, all the items in the folder are tagged with the same retention label. For information about conflict resolution for retention labels, see Will an existing label be overridden or removed. For information about retention labels from an administrator's perspective, see Use retention labels to manage the lifecycle of documents stored in SharePoint. /// /// A /// The request body diff --git a/src/generated/Drives/Item/Items/Item/Workbook/Names/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Drives/Item/Items/Item/Workbook/Names/Item/RangeNamespace/RangeRequestBuilder.cs index 9c68a88d84..ebe90b80c6 100644 --- a/src/generated/Drives/Item/Items/Item/Workbook/Names/Item/RangeNamespace/RangeRequestBuilder.cs +++ b/src/generated/Drives/Item/Items/Item/Workbook/Names/Item/RangeNamespace/RangeRequestBuilder.cs @@ -22,14 +22,14 @@ namespace ApiSdk.Drives.Item.Items.Item.Workbook.Names.Item.RangeNamespace public class RangeRequestBuilder : BaseCliRequestBuilder { /// - /// Retrieve the properties and relationships of range object. - /// Find more info here + /// Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Retrieve the properties and relationships of range object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/range-get?view=graph-rest-1.0"; + command.Description = "Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/nameditem-range?view=graph-rest-1.0"; var driveIdOption = new Option("--drive-id", description: "The unique identifier of drive") { }; driveIdOption.IsRequired = true; @@ -87,7 +87,7 @@ public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/drives/{drive%2Did} { } /// - /// Retrieve the properties and relationships of range object. + /// Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. diff --git a/src/generated/Drives/Item/Items/Item/Workbook/Worksheets/Item/Names/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Drives/Item/Items/Item/Workbook/Worksheets/Item/Names/Item/RangeNamespace/RangeRequestBuilder.cs index 97d6c9a23b..570aca59eb 100644 --- a/src/generated/Drives/Item/Items/Item/Workbook/Worksheets/Item/Names/Item/RangeNamespace/RangeRequestBuilder.cs +++ b/src/generated/Drives/Item/Items/Item/Workbook/Worksheets/Item/Names/Item/RangeNamespace/RangeRequestBuilder.cs @@ -22,14 +22,14 @@ namespace ApiSdk.Drives.Item.Items.Item.Workbook.Worksheets.Item.Names.Item.Rang public class RangeRequestBuilder : BaseCliRequestBuilder { /// - /// Retrieve the properties and relationships of range object. - /// Find more info here + /// Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Retrieve the properties and relationships of range object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/range-get?view=graph-rest-1.0"; + command.Description = "Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/nameditem-range?view=graph-rest-1.0"; var driveIdOption = new Option("--drive-id", description: "The unique identifier of drive") { }; driveIdOption.IsRequired = true; @@ -93,7 +93,7 @@ public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/drives/{drive%2Did} { } /// - /// Retrieve the properties and relationships of range object. + /// Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. diff --git a/src/generated/Education/Classes/Item/Assignments/AssignmentsRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/AssignmentsRequestBuilder.cs index b4d36d1cca..002f4ee8e2 100644 --- a/src/generated/Education/Classes/Item/Assignments/AssignmentsRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/AssignmentsRequestBuilder.cs @@ -66,14 +66,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Create a new assignment. Only teachers in a class can create an assignment. Assignments start in the Draft state, which means that students will not see the assignment until publication. + /// Create a new assignment. Only teachers in a class can create an assignment. Assignments start in draft status, which means that students can't see the assignment until it's published. /// Find more info here /// /// A public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create a new assignment. Only teachers in a class can create an assignment. Assignments start in the Draft state, which means that students will not see the assignment until publication.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/educationclass-post-assignment?view=graph-rest-1.0"; + command.Description = "Create a new assignment. Only teachers in a class can create an assignment. Assignments start in draft status, which means that students can't see the assignment until it's published.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/educationclass-post-assignment?view=graph-rest-1.0"; var educationClassIdOption = new Option("--education-class-id", description: "The unique identifier of educationClass") { }; educationClassIdOption.IsRequired = true; @@ -271,7 +271,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Create a new assignment. Only teachers in a class can create an assignment. Assignments start in the Draft state, which means that students will not see the assignment until publication. + /// Create a new assignment. Only teachers in a class can create an assignment. Assignments start in draft status, which means that students can't see the assignment until it's published. /// /// A /// The request body diff --git a/src/generated/Education/Classes/Item/Assignments/Item/Publish/PublishRequestBuilder.cs b/src/generated/Education/Classes/Item/Assignments/Item/Publish/PublishRequestBuilder.cs index e4c393cf0a..93390953b7 100644 --- a/src/generated/Education/Classes/Item/Assignments/Item/Publish/PublishRequestBuilder.cs +++ b/src/generated/Education/Classes/Item/Assignments/Item/Publish/PublishRequestBuilder.cs @@ -22,14 +22,14 @@ namespace ApiSdk.Education.Classes.Item.Assignments.Item.Publish public class PublishRequestBuilder : BaseCliRequestBuilder { /// - /// Publish an education assignment. Change the state of an educationAssignment from its original draft status to the published status. You can change the state from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The state of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. + /// Publish an education assignment. Change the status of an educationAssignment from its original draft status to the published status. You can change the status from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The status of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. /// Find more info here /// /// A public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "Publish an education assignment. Change the state of an educationAssignment from its original draft status to the published status. You can change the state from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The state of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/educationassignment-publish?view=graph-rest-1.0"; + command.Description = "Publish an education assignment. Change the status of an educationAssignment from its original draft status to the published status. You can change the status from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The status of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/educationassignment-publish?view=graph-rest-1.0"; var educationClassIdOption = new Option("--education-class-id", description: "The unique identifier of educationClass") { }; educationClassIdOption.IsRequired = true; @@ -81,7 +81,7 @@ public PublishRequestBuilder(string rawUrl) : base("{+baseurl}/education/classes { } /// - /// Publish an education assignment. Change the state of an educationAssignment from its original draft status to the published status. You can change the state from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The state of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. + /// Publish an education assignment. Change the status of an educationAssignment from its original draft status to the published status. You can change the status from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The status of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. diff --git a/src/generated/Education/Me/Assignments/Item/Publish/PublishRequestBuilder.cs b/src/generated/Education/Me/Assignments/Item/Publish/PublishRequestBuilder.cs index 440b40e8a8..0687641a10 100644 --- a/src/generated/Education/Me/Assignments/Item/Publish/PublishRequestBuilder.cs +++ b/src/generated/Education/Me/Assignments/Item/Publish/PublishRequestBuilder.cs @@ -22,14 +22,14 @@ namespace ApiSdk.Education.Me.Assignments.Item.Publish public class PublishRequestBuilder : BaseCliRequestBuilder { /// - /// Publish an education assignment. Change the state of an educationAssignment from its original draft status to the published status. You can change the state from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The state of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. + /// Publish an education assignment. Change the status of an educationAssignment from its original draft status to the published status. You can change the status from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The status of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. /// Find more info here /// /// A public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "Publish an education assignment. Change the state of an educationAssignment from its original draft status to the published status. You can change the state from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The state of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/educationassignment-publish?view=graph-rest-1.0"; + command.Description = "Publish an education assignment. Change the status of an educationAssignment from its original draft status to the published status. You can change the status from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The status of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/educationassignment-publish?view=graph-rest-1.0"; var educationAssignmentIdOption = new Option("--education-assignment-id", description: "The unique identifier of educationAssignment") { }; educationAssignmentIdOption.IsRequired = true; @@ -75,7 +75,7 @@ public PublishRequestBuilder(string rawUrl) : base("{+baseurl}/education/me/assi { } /// - /// Publish an education assignment. Change the state of an educationAssignment from its original draft status to the published status. You can change the state from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The state of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. + /// Publish an education assignment. Change the status of an educationAssignment from its original draft status to the published status. You can change the status from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The status of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. diff --git a/src/generated/Education/Users/Item/Assignments/Item/Publish/PublishRequestBuilder.cs b/src/generated/Education/Users/Item/Assignments/Item/Publish/PublishRequestBuilder.cs index bcc5cfe7ad..160e607380 100644 --- a/src/generated/Education/Users/Item/Assignments/Item/Publish/PublishRequestBuilder.cs +++ b/src/generated/Education/Users/Item/Assignments/Item/Publish/PublishRequestBuilder.cs @@ -22,14 +22,14 @@ namespace ApiSdk.Education.Users.Item.Assignments.Item.Publish public class PublishRequestBuilder : BaseCliRequestBuilder { /// - /// Publish an education assignment. Change the state of an educationAssignment from its original draft status to the published status. You can change the state from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The state of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. + /// Publish an education assignment. Change the status of an educationAssignment from its original draft status to the published status. You can change the status from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The status of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. /// Find more info here /// /// A public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "Publish an education assignment. Change the state of an educationAssignment from its original draft status to the published status. You can change the state from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The state of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/educationassignment-publish?view=graph-rest-1.0"; + command.Description = "Publish an education assignment. Change the status of an educationAssignment from its original draft status to the published status. You can change the status from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The status of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/educationassignment-publish?view=graph-rest-1.0"; var educationUserIdOption = new Option("--education-user-id", description: "The unique identifier of educationUser") { }; educationUserIdOption.IsRequired = true; @@ -81,7 +81,7 @@ public PublishRequestBuilder(string rawUrl) : base("{+baseurl}/education/users/{ { } /// - /// Publish an education assignment. Change the state of an educationAssignment from its original draft status to the published status. You can change the state from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The state of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. + /// Publish an education assignment. Change the status of an educationAssignment from its original draft status to the published status. You can change the status from draft to scheduled if the assignment is scheduled for a future date. Only a teacher in the class can make this call. When an assignment is in draft status, students will not see the assignment, nor will there be any submission objects. Calling this API creates educationSubmission objects and displays the assignment in each student's list. The status of the assignment goes back to draft if there is any backend failure during publish process. To update the properties of a published assignment, see update an assignment. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. diff --git a/src/generated/GraphClient.cs b/src/generated/GraphClient.cs index 7b48e656f4..9d0ace4b76 100644 --- a/src/generated/GraphClient.cs +++ b/src/generated/GraphClient.cs @@ -65,6 +65,7 @@ using ApiSdk.Shares; using ApiSdk.Sites; using ApiSdk.Solutions; +using ApiSdk.Storage; using ApiSdk.SubscribedSkus; using ApiSdk.Subscriptions; using ApiSdk.Teams; @@ -1291,6 +1292,7 @@ public Command BuildIdentityNavCommand() var nonExecCommands = new List(); nonExecCommands.Add(builder.BuildApiConnectorsNavCommand()); nonExecCommands.Add(builder.BuildAuthenticationEventListenersNavCommand()); + nonExecCommands.Add(builder.BuildAuthenticationEventsFlowsNavCommand()); nonExecCommands.Add(builder.BuildB2xUserFlowsNavCommand()); nonExecCommands.Add(builder.BuildConditionalAccessNavCommand()); nonExecCommands.Add(builder.BuildCustomAuthenticationExtensionsNavCommand()); @@ -1878,6 +1880,7 @@ public Command BuildRootCommand() command.AddCommand(BuildSharesNavCommand()); command.AddCommand(BuildSitesNavCommand()); command.AddCommand(BuildSolutionsNavCommand()); + command.AddCommand(BuildStorageNavCommand()); command.AddCommand(BuildSubscribedSkusNavCommand()); command.AddCommand(BuildSubscriptionsNavCommand()); command.AddCommand(BuildTeamsNavCommand()); @@ -2139,6 +2142,30 @@ public Command BuildSolutionsNavCommand() return command; } /// + /// Provides operations to manage the storage singleton. + /// + /// A + public Command BuildStorageNavCommand() + { + var command = new Command("storage"); + command.Description = "Provides operations to manage the storage singleton."; + var builder = new StorageRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildFileStorageNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// /// Provides operations to manage the collection of subscribedSku entities. /// /// A diff --git a/src/generated/Groups/Item/Conversations/ConversationsRequestBuilder.cs b/src/generated/Groups/Item/Conversations/ConversationsRequestBuilder.cs index 084cac2d1d..d00e91e52d 100644 --- a/src/generated/Groups/Item/Conversations/ConversationsRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/ConversationsRequestBuilder.cs @@ -55,14 +55,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Use reply thread or reply post to further post to that conversation. - /// Find more info here + /// Create an open extension (openTypeExtension object) and add custom properties in a new or existing instance of a resource. You can create an open extension in a resource instance and store custom data to it all in the same operation, except for specific resources. The table in the Permissions section lists the resources that support open extensions. + /// Find more info here /// /// A public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Use reply thread or reply post to further post to that conversation.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/group-post-conversations?view=graph-rest-1.0"; + command.Description = "Create an open extension (openTypeExtension object) and add custom properties in a new or existing instance of a resource. You can create an open extension in a resource instance and store custom data to it all in the same operation, except for specific resources. The table in the Permissions section lists the resources that support open extensions.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/opentypeextension-post-opentypeextension?view=graph-rest-1.0"; var groupIdOption = new Option("--group-id", description: "The unique identifier of group") { }; groupIdOption.IsRequired = true; @@ -236,7 +236,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Use reply thread or reply post to further post to that conversation. + /// Create an open extension (openTypeExtension object) and add custom properties in a new or existing instance of a resource. You can create an open extension in a resource instance and store custom data to it all in the same operation, except for specific resources. The table in the Permissions section lists the resources that support open extensions. /// /// A /// The request body diff --git a/src/generated/Groups/Item/Conversations/Item/ConversationItemRequestBuilder.cs b/src/generated/Groups/Item/Conversations/Item/ConversationItemRequestBuilder.cs index 1573f9449f..7bab9cc665 100644 --- a/src/generated/Groups/Item/Conversations/Item/ConversationItemRequestBuilder.cs +++ b/src/generated/Groups/Item/Conversations/Item/ConversationItemRequestBuilder.cs @@ -24,13 +24,13 @@ public class ConversationItemRequestBuilder : BaseCliRequestBuilder { /// /// Delete conversation. - /// Find more info here + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete conversation.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/group-delete-conversation?view=graph-rest-1.0"; + command.Description = "Delete conversation.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/conversation-delete?view=graph-rest-1.0"; var groupIdOption = new Option("--group-id", description: "The unique identifier of group") { }; groupIdOption.IsRequired = true; @@ -65,14 +65,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Retrieve the properties and relationships of conversation object. - /// Find more info here + /// The group's conversations. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Retrieve the properties and relationships of conversation object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/conversation-get?view=graph-rest-1.0"; + command.Description = "The group's conversations.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/group-get-conversation?view=graph-rest-1.0"; var groupIdOption = new Option("--group-id", description: "The unique identifier of group") { }; groupIdOption.IsRequired = true; @@ -177,7 +177,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Retrieve the properties and relationships of conversation object. + /// The group's conversations. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -196,7 +196,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Retrieve the properties and relationships of conversation object. + /// The group's conversations. /// public class ConversationItemRequestBuilderGetQueryParameters { diff --git a/src/generated/Groups/Item/Threads/Item/ConversationThreadItemRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/ConversationThreadItemRequestBuilder.cs index 5e454817ed..4cd32b55c8 100644 --- a/src/generated/Groups/Item/Threads/Item/ConversationThreadItemRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/ConversationThreadItemRequestBuilder.cs @@ -25,13 +25,13 @@ public class ConversationThreadItemRequestBuilder : BaseCliRequestBuilder { /// /// Delete conversationThread. - /// Find more info here + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete conversationThread.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/group-delete-thread?view=graph-rest-1.0"; + command.Description = "Delete conversationThread.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/conversationthread-delete?view=graph-rest-1.0"; var groupIdOption = new Option("--group-id", description: "The unique identifier of group") { }; groupIdOption.IsRequired = true; @@ -66,14 +66,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Get a thread object. - /// Find more info here + /// Get a specific thread that belongs to a group. You can specify both the parent conversation and the thread, or, you can specify the thread without referencing the parent conversation. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Get a thread object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/group-get-thread?view=graph-rest-1.0"; + command.Description = "Get a specific thread that belongs to a group. You can specify both the parent conversation and the thread, or, you can specify the thread without referencing the parent conversation. \n\nFind more info here:\n https://learn.microsoft.com/graph/api/conversationthread-get?view=graph-rest-1.0"; var groupIdOption = new Option("--group-id", description: "The unique identifier of group") { }; groupIdOption.IsRequired = true; @@ -252,7 +252,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Get a thread object. + /// Get a specific thread that belongs to a group. You can specify both the parent conversation and the thread, or, you can specify the thread without referencing the parent conversation. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -292,7 +292,7 @@ public RequestInformation ToPatchRequestInformation(ConversationThread body, Act return requestInfo; } /// - /// Get a thread object. + /// Get a specific thread that belongs to a group. You can specify both the parent conversation and the thread, or, you can specify the thread without referencing the parent conversation. /// public class ConversationThreadItemRequestBuilderGetQueryParameters { diff --git a/src/generated/Groups/Item/Threads/Item/Posts/PostsRequestBuilder.cs b/src/generated/Groups/Item/Threads/Item/Posts/PostsRequestBuilder.cs index 476839898f..c0e674cdde 100644 --- a/src/generated/Groups/Item/Threads/Item/Posts/PostsRequestBuilder.cs +++ b/src/generated/Groups/Item/Threads/Item/Posts/PostsRequestBuilder.cs @@ -58,14 +58,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Get the properties and relationships of a post in a specified thread. You can specify both the parent conversation and the thread, or, you can specify the thread without referencing the parent conversation. Since the post resource supports extensions, you can also use the GET operation to get custom properties and extension data in a post instance. - /// Find more info here + /// Get the posts of the specified thread. You can specify both the parent conversation and the thread, or,you can specify the thread without referencing the parent conversation. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Get the properties and relationships of a post in a specified thread. You can specify both the parent conversation and the thread, or, you can specify the thread without referencing the parent conversation. Since the post resource supports extensions, you can also use the GET operation to get custom properties and extension data in a post instance.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/post-get?view=graph-rest-1.0"; + command.Description = "Get the posts of the specified thread. You can specify both the parent conversation and the thread, or,you can specify the thread without referencing the parent conversation.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/conversationthread-list-posts?view=graph-rest-1.0"; var groupIdOption = new Option("--group-id", description: "The unique identifier of group") { }; groupIdOption.IsRequired = true; @@ -181,7 +181,7 @@ public PostsRequestBuilder(string rawUrl) : base("{+baseurl}/groups/{group%2Did} { } /// - /// Get the properties and relationships of a post in a specified thread. You can specify both the parent conversation and the thread, or, you can specify the thread without referencing the parent conversation. Since the post resource supports extensions, you can also use the GET operation to get custom properties and extension data in a post instance. + /// Get the posts of the specified thread. You can specify both the parent conversation and the thread, or,you can specify the thread without referencing the parent conversation. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -200,7 +200,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Get the properties and relationships of a post in a specified thread. You can specify both the parent conversation and the thread, or, you can specify the thread without referencing the parent conversation. Since the post resource supports extensions, you can also use the GET operation to get custom properties and extension data in a post instance. + /// Get the posts of the specified thread. You can specify both the parent conversation and the thread, or,you can specify the thread without referencing the parent conversation. /// public class PostsRequestBuilderGetQueryParameters { diff --git a/src/generated/Identity/AuthenticationEventsFlows/AuthenticationEventsFlowsRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/AuthenticationEventsFlowsRequestBuilder.cs new file mode 100644 index 0000000000..79806cbe07 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/AuthenticationEventsFlowsRequestBuilder.cs @@ -0,0 +1,346 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Count; +using ApiSdk.Identity.AuthenticationEventsFlows.GraphExternalUsersSelfServiceSignUpEventsFlow; +using ApiSdk.Identity.AuthenticationEventsFlows.Item; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows +{ + /// + /// Provides operations to manage the authenticationEventsFlows property of the microsoft.graph.identityContainer entity. + /// + public class AuthenticationEventsFlowsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the authenticationEventsFlows property of the microsoft.graph.identityContainer entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new AuthenticationEventsFlowItemRequestBuilder(PathParameters); + commands.Add(builder.BuildConditionsNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildGraphExternalUsersSelfServiceSignUpEventsFlowByIdNavCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create a new authenticationEventsFlow object that is of the type specified in the request body. The following derived subtypes are supported:- externalUsersSelfServiceSignupEventsFlow object type. + /// Find more info here + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create a new authenticationEventsFlow object that is of the type specified in the request body. The following derived subtypes are supported:- externalUsersSelfServiceSignupEventsFlow object type.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/identitycontainer-post-authenticationeventsflows?view=graph-rest-1.0"; + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AuthenticationEventsFlow.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Casts the previous resource to externalUsersSelfServiceSignUpEventsFlow. + /// + /// A + public Command BuildGraphExternalUsersSelfServiceSignUpEventsFlowNavCommand() + { + var command = new Command("graph-external-users-self-service-sign-up-events-flow"); + command.Description = "Casts the previous resource to externalUsersSelfServiceSignUpEventsFlow."; + var builder = new GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Get a collection of authentication events policies that are derived from authenticationEventsFlow. The following derived subtypes are supported: - externalUsersSelfServiceSignupEventsFlow + /// Find more info here + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Get a collection of authentication events policies that are derived from authenticationEventsFlow. The following derived subtypes are supported: - externalUsersSelfServiceSignupEventsFlow\n\nFind more info here:\n https://learn.microsoft.com/graph/api/identitycontainer-list-authenticationeventsflows?view=graph-rest-1.0"; + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AuthenticationEventsFlowsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AuthenticationEventsFlowsRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get a collection of authentication events policies that are derived from authenticationEventsFlow. The following derived subtypes are supported: - externalUsersSelfServiceSignupEventsFlow + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create a new authenticationEventsFlow object that is of the type specified in the request body. The following derived subtypes are supported:- externalUsersSelfServiceSignupEventsFlow object type. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AuthenticationEventsFlow body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AuthenticationEventsFlow body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get a collection of authentication events policies that are derived from authenticationEventsFlow. The following derived subtypes are supported: - externalUsersSelfServiceSignupEventsFlow + /// + public class AuthenticationEventsFlowsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Count/CountRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..bc9e19999c --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Count/CountRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/GraphExternalUsersSelfServiceSignUpEventsFlow/Count/CountRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/GraphExternalUsersSelfServiceSignUpEventsFlow/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..5a2e430584 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/GraphExternalUsersSelfServiceSignUpEventsFlow/Count/CountRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.GraphExternalUsersSelfServiceSignUpEventsFlow.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/graph.externalUsersSelfServiceSignUpEventsFlow/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/graph.externalUsersSelfServiceSignUpEventsFlow/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/GraphExternalUsersSelfServiceSignUpEventsFlow/GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/GraphExternalUsersSelfServiceSignUpEventsFlow/GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder.cs new file mode 100644 index 0000000000..d603a36847 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/GraphExternalUsersSelfServiceSignUpEventsFlow/GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder.cs @@ -0,0 +1,237 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.GraphExternalUsersSelfServiceSignUpEventsFlow.Count; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.GraphExternalUsersSelfServiceSignUpEventsFlow +{ + /// + /// Casts the previous resource to externalUsersSelfServiceSignUpEventsFlow. + /// + public class GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Get the items of type microsoft.graph.externalUsersSelfServiceSignUpEventsFlow in the microsoft.graph.authenticationEventsFlow collection + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the items of type microsoft.graph.externalUsersSelfServiceSignUpEventsFlow in the microsoft.graph.authenticationEventsFlow collection"; + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/graph.externalUsersSelfServiceSignUpEventsFlow{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/graph.externalUsersSelfServiceSignUpEventsFlow{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get the items of type microsoft.graph.externalUsersSelfServiceSignUpEventsFlow in the microsoft.graph.authenticationEventsFlow collection + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get the items of type microsoft.graph.externalUsersSelfServiceSignUpEventsFlow in the microsoft.graph.authenticationEventsFlow collection + /// + public class GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/AuthenticationEventsFlowItemRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/AuthenticationEventsFlowItemRequestBuilder.cs new file mode 100644 index 0000000000..25a6ef01ef --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/AuthenticationEventsFlowItemRequestBuilder.cs @@ -0,0 +1,315 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions; +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item +{ + /// + /// Provides operations to manage the authenticationEventsFlows property of the microsoft.graph.identityContainer entity. + /// + public class AuthenticationEventsFlowItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// The conditions property + /// + /// A + public Command BuildConditionsNavCommand() + { + var command = new Command("conditions"); + command.Description = "The conditions property"; + var builder = new ConditionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildApplicationsNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete a specific authenticationEventsFlow resource by ID. This operation also removes or unlinks all applications from the flow, which disables the customized authentication experience defined for the application. The following derived subtypes are supported:- externalUsersSelfServiceSignupEventsFlow + /// Find more info here + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete a specific authenticationEventsFlow resource by ID. This operation also removes or unlinks all applications from the flow, which disables the customized authentication experience defined for the application. The following derived subtypes are supported:- externalUsersSelfServiceSignupEventsFlow\n\nFind more info here:\n https://learn.microsoft.com/graph/api/authenticationeventsflow-delete?view=graph-rest-1.0"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Retrieve the properties and relationships of a specific authenticationEventsFlow object by ID. The @odata.type property in the response object indicates the type of the object, which can be one of the following derived subtypes:- externalUsersSelfServiceSignupEventsFlow + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Retrieve the properties and relationships of a specific authenticationEventsFlow object by ID. The @odata.type property in the response object indicates the type of the object, which can be one of the following derived subtypes:- externalUsersSelfServiceSignupEventsFlow\n\nFind more info here:\n https://learn.microsoft.com/graph/api/authenticationeventsflow-get?view=graph-rest-1.0"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Casts the previous resource to externalUsersSelfServiceSignUpEventsFlow. + /// + /// A + public Command BuildGraphExternalUsersSelfServiceSignUpEventsFlowByIdNavCommand() + { + var command = new Command("graph-external-users-self-service-sign-up-events-flow-by-id"); + command.Description = "Casts the previous resource to externalUsersSelfServiceSignUpEventsFlow."; + var builder = new GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildConditionsNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildOnAttributeCollectionNavCommand()); + nonExecCommands.Add(builder.BuildOnAuthenticationMethodLoadStartNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the properties of an authenticationEventsFlow object by ID. You must specify the @odata.type property and the value of the authenticationEventsFlow object type to update. The following derived subtypes are supported:- externalUsersSelfServiceSignupEventsFlow + /// Find more info here + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the properties of an authenticationEventsFlow object by ID. You must specify the @odata.type property and the value of the authenticationEventsFlow object type to update. The following derived subtypes are supported:- externalUsersSelfServiceSignupEventsFlow\n\nFind more info here:\n https://learn.microsoft.com/graph/api/authenticationeventsflow-update?view=graph-rest-1.0"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AuthenticationEventsFlow.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AuthenticationEventsFlowItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AuthenticationEventsFlowItemRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete a specific authenticationEventsFlow resource by ID. This operation also removes or unlinks all applications from the flow, which disables the customized authentication experience defined for the application. The following derived subtypes are supported:- externalUsersSelfServiceSignupEventsFlow + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the properties and relationships of a specific authenticationEventsFlow object by ID. The @odata.type property in the response object indicates the type of the object, which can be one of the following derived subtypes:- externalUsersSelfServiceSignupEventsFlow + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the properties of an authenticationEventsFlow object by ID. You must specify the @odata.type property and the value of the authenticationEventsFlow object type to update. The following derived subtypes are supported:- externalUsersSelfServiceSignupEventsFlow + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(AuthenticationEventsFlow body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(AuthenticationEventsFlow body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the properties and relationships of a specific authenticationEventsFlow object by ID. The @odata.type property in the response object indicates the type of the object, which can be one of the following derived subtypes:- externalUsersSelfServiceSignupEventsFlow + /// + public class AuthenticationEventsFlowItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/ApplicationsRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/ApplicationsRequestBuilder.cs new file mode 100644 index 0000000000..1f49adc0f2 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/ApplicationsRequestBuilder.cs @@ -0,0 +1,62 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions.Applications.IncludeApplications; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions.Applications +{ + /// + /// Builds and executes requests for operations under \identity\authenticationEventsFlows\{authenticationEventsFlow-id}\conditions\applications + /// + public class ApplicationsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity. + /// + /// A + public Command BuildIncludeApplicationsNavCommand() + { + var command = new Command("include-applications"); + command.Description = "Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity."; + var builder = new IncludeApplicationsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplicationsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions/applications", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplicationsRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions/applications", rawUrl) + { + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/IncludeApplications/Count/CountRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/IncludeApplications/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..1523b1f834 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/IncludeApplications/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions.Applications.IncludeApplications.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions/applications/includeApplications/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions/applications/includeApplications/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/IncludeApplications/IncludeApplicationsRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/IncludeApplications/IncludeApplicationsRequestBuilder.cs new file mode 100644 index 0000000000..e159673096 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/IncludeApplications/IncludeApplicationsRequestBuilder.cs @@ -0,0 +1,329 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions.Applications.IncludeApplications.Count; +using ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions.Applications.IncludeApplications.Item; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions.Applications.IncludeApplications +{ + /// + /// Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity. + /// + public class IncludeApplicationsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var builder = new AuthenticationConditionApplicationAppItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, new(0)); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to includeApplications for identity + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to includeApplications for identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AuthenticationConditionApplication.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Get includeApplications from identity + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Get includeApplications from identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IncludeApplicationsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions/applications/includeApplications{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IncludeApplicationsRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions/applications/includeApplications{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get includeApplications from identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to includeApplications for identity + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AuthenticationConditionApplication body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AuthenticationConditionApplication body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get includeApplications from identity + /// + public class IncludeApplicationsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/IncludeApplications/Item/AuthenticationConditionApplicationAppItemRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/IncludeApplications/Item/AuthenticationConditionApplicationAppItemRequestBuilder.cs new file mode 100644 index 0000000000..508524e6af --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/Applications/IncludeApplications/Item/AuthenticationConditionApplicationAppItemRequestBuilder.cs @@ -0,0 +1,280 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions.Applications.IncludeApplications.Item +{ + /// + /// Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity. + /// + public class AuthenticationConditionApplicationAppItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property includeApplications for identity + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property includeApplications for identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppIdOption = new Option("--authentication-condition-application-app-id", description: "The unique identifier of authenticationConditionApplication") { + }; + authenticationConditionApplicationAppIdOption.IsRequired = true; + command.AddOption(authenticationConditionApplicationAppIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppId = invocationContext.ParseResult.GetValueForOption(authenticationConditionApplicationAppIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (authenticationConditionApplicationAppId is not null) requestInfo.PathParameters.Add("authenticationConditionApplication%2DappId", authenticationConditionApplicationAppId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get includeApplications from identity + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get includeApplications from identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppIdOption = new Option("--authentication-condition-application-app-id", description: "The unique identifier of authenticationConditionApplication") { + }; + authenticationConditionApplicationAppIdOption.IsRequired = true; + command.AddOption(authenticationConditionApplicationAppIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppId = invocationContext.ParseResult.GetValueForOption(authenticationConditionApplicationAppIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (authenticationConditionApplicationAppId is not null) requestInfo.PathParameters.Add("authenticationConditionApplication%2DappId", authenticationConditionApplicationAppId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property includeApplications in identity + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property includeApplications in identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppIdOption = new Option("--authentication-condition-application-app-id", description: "The unique identifier of authenticationConditionApplication") { + }; + authenticationConditionApplicationAppIdOption.IsRequired = true; + command.AddOption(authenticationConditionApplicationAppIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppId = invocationContext.ParseResult.GetValueForOption(authenticationConditionApplicationAppIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AuthenticationConditionApplication.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (authenticationConditionApplicationAppId is not null) requestInfo.PathParameters.Add("authenticationConditionApplication%2DappId", authenticationConditionApplicationAppId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AuthenticationConditionApplicationAppItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions/applications/includeApplications/{authenticationConditionApplication%2DappId}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AuthenticationConditionApplicationAppItemRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions/applications/includeApplications/{authenticationConditionApplication%2DappId}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property includeApplications for identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get includeApplications from identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property includeApplications in identity + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(AuthenticationConditionApplication body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(AuthenticationConditionApplication body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get includeApplications from identity + /// + public class AuthenticationConditionApplicationAppItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/ConditionsRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/ConditionsRequestBuilder.cs new file mode 100644 index 0000000000..231451dee0 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/Conditions/ConditionsRequestBuilder.cs @@ -0,0 +1,154 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions.Applications; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.Conditions +{ + /// + /// Builds and executes requests for operations under \identity\authenticationEventsFlows\{authenticationEventsFlow-id}\conditions + /// + public class ConditionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// The applications property + /// + /// A + public Command BuildApplicationsNavCommand() + { + var command = new Command("applications"); + command.Description = "The applications property"; + var builder = new ApplicationsRequestBuilder(PathParameters); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildIncludeApplicationsNavCommand()); + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The conditions representing the context of the authentication request that's used to decide whether the events policy is invoked. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The conditions representing the context of the authentication request that's used to decide whether the events policy is invoked."; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ConditionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ConditionsRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/conditions{?%24expand,%24select}", rawUrl) + { + } + /// + /// The conditions representing the context of the authentication request that's used to decide whether the events policy is invoked. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The conditions representing the context of the authentication request that's used to decide whether the events policy is invoked. + /// + public class ConditionsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/ApplicationsRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/ApplicationsRequestBuilder.cs new file mode 100644 index 0000000000..623d050f7d --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/ApplicationsRequestBuilder.cs @@ -0,0 +1,62 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions.Applications.IncludeApplications; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions.Applications +{ + /// + /// Builds and executes requests for operations under \identity\authenticationEventsFlows\{authenticationEventsFlow-id}\graph.externalUsersSelfServiceSignUpEventsFlow\conditions\applications + /// + public class ApplicationsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity. + /// + /// A + public Command BuildIncludeApplicationsNavCommand() + { + var command = new Command("include-applications"); + command.Description = "Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity."; + var builder = new IncludeApplicationsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplicationsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions/applications", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplicationsRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions/applications", rawUrl) + { + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/IncludeApplications/Count/CountRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/IncludeApplications/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..157078dd18 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/IncludeApplications/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions.Applications.IncludeApplications.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions/applications/includeApplications/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions/applications/includeApplications/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/IncludeApplications/IncludeApplicationsRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/IncludeApplications/IncludeApplicationsRequestBuilder.cs new file mode 100644 index 0000000000..c3ae13e801 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/IncludeApplications/IncludeApplicationsRequestBuilder.cs @@ -0,0 +1,329 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions.Applications.IncludeApplications.Count; +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions.Applications.IncludeApplications.Item; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions.Applications.IncludeApplications +{ + /// + /// Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity. + /// + public class IncludeApplicationsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var builder = new AuthenticationConditionApplicationAppItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, new(0)); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to includeApplications for identity + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to includeApplications for identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AuthenticationConditionApplication.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Get includeApplications from identity + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Get includeApplications from identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IncludeApplicationsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions/applications/includeApplications{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IncludeApplicationsRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions/applications/includeApplications{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get includeApplications from identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to includeApplications for identity + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AuthenticationConditionApplication body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AuthenticationConditionApplication body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get includeApplications from identity + /// + public class IncludeApplicationsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/IncludeApplications/Item/AuthenticationConditionApplicationAppItemRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/IncludeApplications/Item/AuthenticationConditionApplicationAppItemRequestBuilder.cs new file mode 100644 index 0000000000..0cc65f3b64 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/Applications/IncludeApplications/Item/AuthenticationConditionApplicationAppItemRequestBuilder.cs @@ -0,0 +1,280 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions.Applications.IncludeApplications.Item +{ + /// + /// Provides operations to manage the includeApplications property of the microsoft.graph.authenticationConditionsApplications entity. + /// + public class AuthenticationConditionApplicationAppItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property includeApplications for identity + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property includeApplications for identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppIdOption = new Option("--authentication-condition-application-app-id", description: "The unique identifier of authenticationConditionApplication") { + }; + authenticationConditionApplicationAppIdOption.IsRequired = true; + command.AddOption(authenticationConditionApplicationAppIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppId = invocationContext.ParseResult.GetValueForOption(authenticationConditionApplicationAppIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (authenticationConditionApplicationAppId is not null) requestInfo.PathParameters.Add("authenticationConditionApplication%2DappId", authenticationConditionApplicationAppId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get includeApplications from identity + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get includeApplications from identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppIdOption = new Option("--authentication-condition-application-app-id", description: "The unique identifier of authenticationConditionApplication") { + }; + authenticationConditionApplicationAppIdOption.IsRequired = true; + command.AddOption(authenticationConditionApplicationAppIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppId = invocationContext.ParseResult.GetValueForOption(authenticationConditionApplicationAppIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (authenticationConditionApplicationAppId is not null) requestInfo.PathParameters.Add("authenticationConditionApplication%2DappId", authenticationConditionApplicationAppId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property includeApplications in identity + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property includeApplications in identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppIdOption = new Option("--authentication-condition-application-app-id", description: "The unique identifier of authenticationConditionApplication") { + }; + authenticationConditionApplicationAppIdOption.IsRequired = true; + command.AddOption(authenticationConditionApplicationAppIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var authenticationConditionApplicationAppId = invocationContext.ParseResult.GetValueForOption(authenticationConditionApplicationAppIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AuthenticationConditionApplication.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (authenticationConditionApplicationAppId is not null) requestInfo.PathParameters.Add("authenticationConditionApplication%2DappId", authenticationConditionApplicationAppId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AuthenticationConditionApplicationAppItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions/applications/includeApplications/{authenticationConditionApplication%2DappId}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AuthenticationConditionApplicationAppItemRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions/applications/includeApplications/{authenticationConditionApplication%2DappId}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property includeApplications for identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get includeApplications from identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property includeApplications in identity + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(AuthenticationConditionApplication body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(AuthenticationConditionApplication body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get includeApplications from identity + /// + public class AuthenticationConditionApplicationAppItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/ConditionsRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/ConditionsRequestBuilder.cs new file mode 100644 index 0000000000..a0f0eb5313 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/Conditions/ConditionsRequestBuilder.cs @@ -0,0 +1,154 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions.Applications; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions +{ + /// + /// Builds and executes requests for operations under \identity\authenticationEventsFlows\{authenticationEventsFlow-id}\graph.externalUsersSelfServiceSignUpEventsFlow\conditions + /// + public class ConditionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// The applications property + /// + /// A + public Command BuildApplicationsNavCommand() + { + var command = new Command("applications"); + command.Description = "The applications property"; + var builder = new ApplicationsRequestBuilder(PathParameters); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildIncludeApplicationsNavCommand()); + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The conditions representing the context of the authentication request that's used to decide whether the events policy is invoked. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The conditions representing the context of the authentication request that's used to decide whether the events policy is invoked."; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ConditionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ConditionsRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/conditions{?%24expand,%24select}", rawUrl) + { + } + /// + /// The conditions representing the context of the authentication request that's used to decide whether the events policy is invoked. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The conditions representing the context of the authentication request that's used to decide whether the events policy is invoked. + /// + public class ConditionsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder.cs new file mode 100644 index 0000000000..c2eb96f360 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder.cs @@ -0,0 +1,208 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.Conditions; +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection; +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow +{ + /// + /// Casts the previous resource to externalUsersSelfServiceSignUpEventsFlow. + /// + public class GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder : BaseCliRequestBuilder + { + /// + /// The conditions property + /// + /// A + public Command BuildConditionsNavCommand() + { + var command = new Command("conditions"); + command.Description = "The conditions property"; + var builder = new ConditionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildApplicationsNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Get the item of type microsoft.graph.authenticationEventsFlow as microsoft.graph.externalUsersSelfServiceSignUpEventsFlow + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the item of type microsoft.graph.authenticationEventsFlow as microsoft.graph.externalUsersSelfServiceSignUpEventsFlow"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The onAttributeCollection property + /// + /// A + public Command BuildOnAttributeCollectionNavCommand() + { + var command = new Command("on-attribute-collection"); + command.Description = "The onAttributeCollection property"; + var builder = new OnAttributeCollectionRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildGraphOnAttributeCollectionExternalUsersSelfServiceSignUpNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The onAuthenticationMethodLoadStart property + /// + /// A + public Command BuildOnAuthenticationMethodLoadStartNavCommand() + { + var command = new Command("on-authentication-method-load-start"); + command.Description = "The onAuthenticationMethodLoadStart property"; + var builder = new OnAuthenticationMethodLoadStartRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildGraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUpNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow{?%24expand,%24select}", rawUrl) + { + } + /// + /// Get the item of type microsoft.graph.authenticationEventsFlow as microsoft.graph.externalUsersSelfServiceSignUpEventsFlow + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get the item of type microsoft.graph.authenticationEventsFlow as microsoft.graph.externalUsersSelfServiceSignUpEventsFlow + /// + public class GraphExternalUsersSelfServiceSignUpEventsFlowRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/AttributesRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/AttributesRequestBuilder.cs new file mode 100644 index 0000000000..e00e2d966d --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/AttributesRequestBuilder.cs @@ -0,0 +1,276 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes.Count; +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes.Item; +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes.Ref; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes +{ + /// + /// Provides operations to manage the attributes property of the microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp entity. + /// + public class AttributesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets an item from the ApiSdk.identity.authenticationEventsFlows.item.graphExternalUsersSelfServiceSignUpEventsFlow.onAttributeCollection.graphOnAttributeCollectionExternalUsersSelfServiceSignUp.attributes.item collection + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var commands = new List(); + var builder = new IdentityUserFlowAttributeItemRequestBuilder(PathParameters); + commands.Add(builder.BuildRefByIdNavCommand()); + return new(new(0), commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Get an identityUserFlowAttribute collection associated with an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. These attributes are collected from the user during the authentication experience defined by the user flow. + /// Find more info here + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Get an identityUserFlowAttribute collection associated with an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. These attributes are collected from the user during the authentication experience defined by the user flow.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/onattributecollectionexternalusersselfservicesignup-list-attributes?view=graph-rest-1.0"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the collection of identityContainer entities. + /// + /// A + public Command BuildRefNavCommand() + { + var command = new Command("ref"); + command.Description = "Provides operations to manage the collection of identityContainer entities."; + var builder = new RefRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AttributesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AttributesRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get an identityUserFlowAttribute collection associated with an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. These attributes are collected from the user during the authentication experience defined by the user flow. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get an identityUserFlowAttribute collection associated with an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. These attributes are collected from the user during the authentication experience defined by the user flow. + /// + public class AttributesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Count/CountRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..3635b4ff43 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Item/IdentityUserFlowAttributeItemRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Item/IdentityUserFlowAttributeItemRequestBuilder.cs new file mode 100644 index 0000000000..23fd4f7e0b --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Item/IdentityUserFlowAttributeItemRequestBuilder.cs @@ -0,0 +1,52 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes.Item.Ref; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes.Item +{ + /// + /// Builds and executes requests for operations under \identity\authenticationEventsFlows\{authenticationEventsFlow-id}\graph.externalUsersSelfServiceSignUpEventsFlow\onAttributeCollection\graph.onAttributeCollectionExternalUsersSelfServiceSignUp\attributes\{identityUserFlowAttribute-id} + /// + public class IdentityUserFlowAttributeItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the collection of identityContainer entities. + /// + /// A + public Command BuildRefByIdNavCommand() + { + var command = new Command("ref-by-id"); + command.Description = "Provides operations to manage the collection of identityContainer entities."; + var builder = new RefRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IdentityUserFlowAttributeItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/{identityUserFlowAttribute%2Did}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IdentityUserFlowAttributeItemRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/{identityUserFlowAttribute%2Did}", rawUrl) + { + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Item/Ref/RefRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Item/Ref/RefRequestBuilder.cs new file mode 100644 index 0000000000..58e7b86105 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Item/Ref/RefRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes.Item.Ref +{ + /// + /// Provides operations to manage the collection of identityContainer entities. + /// + public class RefRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete ref of navigation property attributes for identity + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete ref of navigation property attributes for identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var identityUserFlowAttributeIdOption = new Option("--identity-user-flow-attribute-id", description: "The unique identifier of identityUserFlowAttribute") { + }; + identityUserFlowAttributeIdOption.IsRequired = true; + command.AddOption(identityUserFlowAttributeIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var identityUserFlowAttributeId = invocationContext.ParseResult.GetValueForOption(identityUserFlowAttributeIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (identityUserFlowAttributeId is not null) requestInfo.PathParameters.Add("identityUserFlowAttribute%2Did", identityUserFlowAttributeId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RefRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/{identityUserFlowAttribute%2Did}/$ref", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RefRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/{identityUserFlowAttribute%2Did}/$ref", rawUrl) + { + } + /// + /// Delete ref of navigation property attributes for identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Ref/RefRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Ref/RefRequestBuilder.cs new file mode 100644 index 0000000000..177054990c --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/Attributes/Ref/RefRequestBuilder.cs @@ -0,0 +1,331 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes.Ref +{ + /// + /// Provides operations to manage the collection of identityContainer entities. + /// + public class RefRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete ref of navigation property attributes for identity + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete ref of navigation property attributes for identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + var idOption = new Option("--id", description: "The delete Uri") { + }; + idOption.IsRequired = true; + command.AddOption(idOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var id = invocationContext.ParseResult.GetValueForOption(idOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + if (!string.IsNullOrEmpty(id)) q.QueryParameters.Id = id; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get an identityUserFlowAttribute collection associated with an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. These attributes are collected from the user during the authentication experience defined by the user flow. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get an identityUserFlowAttribute collection associated with an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. These attributes are collected from the user during the authentication experience defined by the user flow.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/onattributecollectionexternalusersselfservicesignup-list-attributes?view=graph-rest-1.0"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Add an attribute to an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. You can add both custom and built-in attributes to a user flow. Prerequisite: PATCH the user flow with the updated onAttributeCollection event that includes the new attribute. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Add an attribute to an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. You can add both custom and built-in attributes to a user flow. Prerequisite: PATCH the user flow with the updated onAttributeCollection event that includes the new attribute.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/onattributecollectionexternalusersselfservicesignup-post-attributes?view=graph-rest-1.0"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ReferenceCreate.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RefRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/$ref?@id={%40id}{&%24count,%24filter,%24orderby,%24search,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RefRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/$ref?@id={%40id}{&%24count,%24filter,%24orderby,%24search,%24skip,%24top}", rawUrl) + { + } + /// + /// Delete ref of navigation property attributes for identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, "{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/$ref?@id={%40id}", PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get an identityUserFlowAttribute collection associated with an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. These attributes are collected from the user during the authentication experience defined by the user flow. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, "{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/$ref{?%24count,%24filter,%24orderby,%24search,%24skip,%24top}", PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Add an attribute to an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. You can add both custom and built-in attributes to a user flow. Prerequisite: PATCH the user flow with the updated onAttributeCollection event that includes the new attribute. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ReferenceCreate body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ReferenceCreate body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp/attributes/$ref", PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Delete ref of navigation property attributes for identity + /// + public class RefRequestBuilderDeleteQueryParameters + { + /// The delete Uri +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%40id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("%40id")] + public string Id { get; set; } +#endif + } + /// + /// Get an identityUserFlowAttribute collection associated with an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object. These attributes are collected from the user during the authentication experience defined by the user flow. + /// + public class RefRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/GraphOnAttributeCollectionExternalUsersSelfServiceSignUpRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/GraphOnAttributeCollectionExternalUsersSelfServiceSignUpRequestBuilder.cs new file mode 100644 index 0000000000..ef78745402 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/GraphOnAttributeCollectionExternalUsersSelfServiceSignUp/GraphOnAttributeCollectionExternalUsersSelfServiceSignUpRequestBuilder.cs @@ -0,0 +1,129 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp.Attributes; +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp +{ + /// + /// Casts the previous resource to onAttributeCollectionExternalUsersSelfServiceSignUp. + /// + public class GraphOnAttributeCollectionExternalUsersSelfServiceSignUpRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the attributes property of the microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp entity. + /// + /// A + public Command BuildAttributesNavCommand() + { + var command = new Command("attributes"); + command.Description = "Provides operations to manage the attributes property of the microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp entity."; + var builder = new AttributesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildListCommand()); + nonExecCommands.Add(builder.BuildRefNavCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Get the items of type microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp in the microsoft.graph.onAttributeCollectionHandler collection + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the items of type microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp in the microsoft.graph.onAttributeCollectionHandler collection"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GraphOnAttributeCollectionExternalUsersSelfServiceSignUpRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GraphOnAttributeCollectionExternalUsersSelfServiceSignUpRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection/graph.onAttributeCollectionExternalUsersSelfServiceSignUp", rawUrl) + { + } + /// + /// Get the items of type microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp in the microsoft.graph.onAttributeCollectionHandler collection + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/OnAttributeCollectionRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/OnAttributeCollectionRequestBuilder.cs new file mode 100644 index 0000000000..c3930cc840 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAttributeCollection/OnAttributeCollectionRequestBuilder.cs @@ -0,0 +1,160 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection.GraphOnAttributeCollectionExternalUsersSelfServiceSignUp; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAttributeCollection +{ + /// + /// Builds and executes requests for operations under \identity\authenticationEventsFlows\{authenticationEventsFlow-id}\graph.externalUsersSelfServiceSignUpEventsFlow\onAttributeCollection + /// + public class OnAttributeCollectionRequestBuilder : BaseCliRequestBuilder + { + /// + /// The configuration for what to invoke when attributes are ready to be collected from the user. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The configuration for what to invoke when attributes are ready to be collected from the user."; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Casts the previous resource to onAttributeCollectionExternalUsersSelfServiceSignUp. + /// + /// A + public Command BuildGraphOnAttributeCollectionExternalUsersSelfServiceSignUpNavCommand() + { + var command = new Command("graph-on-attribute-collection-external-users-self-service-sign-up"); + command.Description = "Casts the previous resource to onAttributeCollectionExternalUsersSelfServiceSignUp."; + var builder = new GraphOnAttributeCollectionExternalUsersSelfServiceSignUpRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAttributesNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OnAttributeCollectionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OnAttributeCollectionRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAttributeCollection{?%24expand,%24select}", rawUrl) + { + } + /// + /// The configuration for what to invoke when attributes are ready to be collected from the user. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The configuration for what to invoke when attributes are ready to be collected from the user. + /// + public class OnAttributeCollectionRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUpRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUpRequestBuilder.cs new file mode 100644 index 0000000000..950e2aa19e --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUpRequestBuilder.cs @@ -0,0 +1,129 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders; +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp +{ + /// + /// Casts the previous resource to onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp. + /// + public class GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUpRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the items of type microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp in the microsoft.graph.onAuthenticationMethodLoadStartHandler collection + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the items of type microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp in the microsoft.graph.onAuthenticationMethodLoadStartHandler collection"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// Provides operations to manage the identityProviders property of the microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp entity. + /// + /// A + public Command BuildIdentityProvidersNavCommand() + { + var command = new Command("identity-providers"); + command.Description = "Provides operations to manage the identityProviders property of the microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp entity."; + var builder = new IdentityProvidersRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildListCommand()); + nonExecCommands.Add(builder.BuildRefNavCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUpRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUpRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp", rawUrl) + { + } + /// + /// Get the items of type microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp in the microsoft.graph.onAuthenticationMethodLoadStartHandler collection + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Count/CountRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..3764b0dfeb --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/IdentityProvidersRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/IdentityProvidersRequestBuilder.cs new file mode 100644 index 0000000000..12566cb58b --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/IdentityProvidersRequestBuilder.cs @@ -0,0 +1,276 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders.Count; +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders.Item; +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders.Ref; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders +{ + /// + /// Provides operations to manage the identityProviders property of the microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp entity. + /// + public class IdentityProvidersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets an item from the ApiSdk.identity.authenticationEventsFlows.item.graphExternalUsersSelfServiceSignUpEventsFlow.onAuthenticationMethodLoadStart.graphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.identityProviders.item collection + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var commands = new List(); + var builder = new IdentityProviderBaseItemRequestBuilder(PathParameters); + commands.Add(builder.BuildRefByIdNavCommand()); + return new(new(0), commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Get the identity providers that are defined for an external identities self-service sign up user flow that's represented by an externalUsersSelfServiceSignupEventsFlow object type. + /// Find more info here + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Get the identity providers that are defined for an external identities self-service sign up user flow that's represented by an externalUsersSelfServiceSignupEventsFlow object type.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/onauthenticationmethodloadstartexternalusersselfservicesignup-list-identityproviders?view=graph-rest-1.0"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the collection of identityContainer entities. + /// + /// A + public Command BuildRefNavCommand() + { + var command = new Command("ref"); + command.Description = "Provides operations to manage the collection of identityContainer entities."; + var builder = new RefRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IdentityProvidersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IdentityProvidersRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get the identity providers that are defined for an external identities self-service sign up user flow that's represented by an externalUsersSelfServiceSignupEventsFlow object type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get the identity providers that are defined for an external identities self-service sign up user flow that's represented by an externalUsersSelfServiceSignupEventsFlow object type. + /// + public class IdentityProvidersRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Item/IdentityProviderBaseItemRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Item/IdentityProviderBaseItemRequestBuilder.cs new file mode 100644 index 0000000000..b6ad50e270 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Item/IdentityProviderBaseItemRequestBuilder.cs @@ -0,0 +1,52 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders.Item.Ref; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders.Item +{ + /// + /// Builds and executes requests for operations under \identity\authenticationEventsFlows\{authenticationEventsFlow-id}\graph.externalUsersSelfServiceSignUpEventsFlow\onAuthenticationMethodLoadStart\graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp\identityProviders\{identityProviderBase-id} + /// + public class IdentityProviderBaseItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the collection of identityContainer entities. + /// + /// A + public Command BuildRefByIdNavCommand() + { + var command = new Command("ref-by-id"); + command.Description = "Provides operations to manage the collection of identityContainer entities."; + var builder = new RefRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IdentityProviderBaseItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/{identityProviderBase%2Did}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IdentityProviderBaseItemRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/{identityProviderBase%2Did}", rawUrl) + { + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Item/Ref/RefRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Item/Ref/RefRequestBuilder.cs new file mode 100644 index 0000000000..03b5382680 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Item/Ref/RefRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders.Item.Ref +{ + /// + /// Provides operations to manage the collection of identityContainer entities. + /// + public class RefRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete ref of navigation property identityProviders for identity + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete ref of navigation property identityProviders for identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var identityProviderBaseIdOption = new Option("--identity-provider-base-id", description: "The unique identifier of identityProviderBase") { + }; + identityProviderBaseIdOption.IsRequired = true; + command.AddOption(identityProviderBaseIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var identityProviderBaseId = invocationContext.ParseResult.GetValueForOption(identityProviderBaseIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (identityProviderBaseId is not null) requestInfo.PathParameters.Add("identityProviderBase%2Did", identityProviderBaseId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RefRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/{identityProviderBase%2Did}/$ref", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RefRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/{identityProviderBase%2Did}/$ref", rawUrl) + { + } + /// + /// Delete ref of navigation property identityProviders for identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Ref/RefRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Ref/RefRequestBuilder.cs new file mode 100644 index 0000000000..d39ecb0139 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/IdentityProviders/Ref/RefRequestBuilder.cs @@ -0,0 +1,331 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.IdentityProviders.Ref +{ + /// + /// Provides operations to manage the collection of identityContainer entities. + /// + public class RefRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete ref of navigation property identityProviders for identity + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete ref of navigation property identityProviders for identity"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + var idOption = new Option("--id", description: "The delete Uri") { + }; + idOption.IsRequired = true; + command.AddOption(idOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var id = invocationContext.ParseResult.GetValueForOption(idOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + if (!string.IsNullOrEmpty(id)) q.QueryParameters.Id = id; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get the identity providers that are defined for an external identities self-service sign up user flow that's represented by an externalUsersSelfServiceSignupEventsFlow object type. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the identity providers that are defined for an external identities self-service sign up user flow that's represented by an externalUsersSelfServiceSignupEventsFlow object type.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/onauthenticationmethodloadstartexternalusersselfservicesignup-list-identityproviders?view=graph-rest-1.0"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Add an identity provider to an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object type. The identity provider must first be configured in the tenant. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Add an identity provider to an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object type. The identity provider must first be configured in the tenant.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/onauthenticationmethodloadstartexternalusersselfservicesignup-post-identityproviders?view=graph-rest-1.0"; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ReferenceCreate.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RefRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$ref?@id={%40id}{&%24count,%24filter,%24orderby,%24search,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RefRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$ref?@id={%40id}{&%24count,%24filter,%24orderby,%24search,%24skip,%24top}", rawUrl) + { + } + /// + /// Delete ref of navigation property identityProviders for identity + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, "{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$ref?@id={%40id}", PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get the identity providers that are defined for an external identities self-service sign up user flow that's represented by an externalUsersSelfServiceSignupEventsFlow object type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, "{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$ref{?%24count,%24filter,%24orderby,%24search,%24skip,%24top}", PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Add an identity provider to an external identities self-service user flow represented by an externalUsersSelfServiceSignupEventsFlow object type. The identity provider must first be configured in the tenant. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ReferenceCreate body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ReferenceCreate body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart/graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$ref", PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Delete ref of navigation property identityProviders for identity + /// + public class RefRequestBuilderDeleteQueryParameters + { + /// The delete Uri +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%40id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("%40id")] + public string Id { get; set; } +#endif + } + /// + /// Get the identity providers that are defined for an external identities self-service sign up user flow that's represented by an externalUsersSelfServiceSignupEventsFlow object type. + /// + public class RefRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/OnAuthenticationMethodLoadStartRequestBuilder.cs b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/OnAuthenticationMethodLoadStartRequestBuilder.cs new file mode 100644 index 0000000000..446595be98 --- /dev/null +++ b/src/generated/Identity/AuthenticationEventsFlows/Item/GraphExternalUsersSelfServiceSignUpEventsFlow/OnAuthenticationMethodLoadStart/OnAuthenticationMethodLoadStartRequestBuilder.cs @@ -0,0 +1,160 @@ +// +using ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart.GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp; +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Identity.AuthenticationEventsFlows.Item.GraphExternalUsersSelfServiceSignUpEventsFlow.OnAuthenticationMethodLoadStart +{ + /// + /// Builds and executes requests for operations under \identity\authenticationEventsFlows\{authenticationEventsFlow-id}\graph.externalUsersSelfServiceSignUpEventsFlow\onAuthenticationMethodLoadStart + /// + public class OnAuthenticationMethodLoadStartRequestBuilder : BaseCliRequestBuilder + { + /// + /// Required. The configuration for what to invoke when authentication methods are ready to be presented to the user. Must have at least one identity provider linked. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Required. The configuration for what to invoke when authentication methods are ready to be presented to the user. Must have at least one identity provider linked."; + var authenticationEventsFlowIdOption = new Option("--authentication-events-flow-id", description: "The unique identifier of authenticationEventsFlow") { + }; + authenticationEventsFlowIdOption.IsRequired = true; + command.AddOption(authenticationEventsFlowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var authenticationEventsFlowId = invocationContext.ParseResult.GetValueForOption(authenticationEventsFlowIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (authenticationEventsFlowId is not null) requestInfo.PathParameters.Add("authenticationEventsFlow%2Did", authenticationEventsFlowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Casts the previous resource to onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp. + /// + /// A + public Command BuildGraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUpNavCommand() + { + var command = new Command("graph-on-authentication-method-load-start-external-users-self-service-sign-up"); + command.Description = "Casts the previous resource to onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp."; + var builder = new GraphOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUpRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildIdentityProvidersNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OnAuthenticationMethodLoadStartRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OnAuthenticationMethodLoadStartRequestBuilder(string rawUrl) : base("{+baseurl}/identity/authenticationEventsFlows/{authenticationEventsFlow%2Did}/graph.externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStart{?%24expand,%24select}", rawUrl) + { + } + /// + /// Required. The configuration for what to invoke when authentication methods are ready to be presented to the user. Must have at least one identity provider linked. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Required. The configuration for what to invoke when authentication methods are ready to be presented to the user. Must have at least one identity provider linked. + /// + public class OnAuthenticationMethodLoadStartRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Identity/ConditionalAccess/NamedLocations/Item/NamedLocationItemRequestBuilder.cs b/src/generated/Identity/ConditionalAccess/NamedLocations/Item/NamedLocationItemRequestBuilder.cs index a04d259cdb..60e0352b22 100644 --- a/src/generated/Identity/ConditionalAccess/NamedLocations/Item/NamedLocationItemRequestBuilder.cs +++ b/src/generated/Identity/ConditionalAccess/NamedLocations/Item/NamedLocationItemRequestBuilder.cs @@ -22,14 +22,14 @@ namespace ApiSdk.Identity.ConditionalAccess.NamedLocations.Item public class NamedLocationItemRequestBuilder : BaseCliRequestBuilder { /// - /// Delete a countryNamedLocation object. - /// Find more info here + /// Delete an ipNamedLocation object. + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete a countryNamedLocation object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/countrynamedlocation-delete?view=graph-rest-1.0"; + command.Description = "Delete an ipNamedLocation object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/ipnamedlocation-delete?view=graph-rest-1.0"; var namedLocationIdOption = new Option("--named-location-id", description: "The unique identifier of namedLocation") { }; namedLocationIdOption.IsRequired = true; @@ -58,14 +58,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Retrieve the properties and relationships of a namedLocation object. - /// Find more info here + /// Retrieve the properties and relationships of an ipNamedLocation object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Retrieve the properties and relationships of a namedLocation object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/namedlocation-get?view=graph-rest-1.0"; + command.Description = "Retrieve the properties and relationships of an ipNamedLocation object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/ipnamedlocation-get?view=graph-rest-1.0"; var namedLocationIdOption = new Option("--named-location-id", description: "The unique identifier of namedLocation") { }; namedLocationIdOption.IsRequired = true; @@ -111,14 +111,14 @@ public Command BuildGetCommand() return command; } /// - /// Update the properties of a countryNamedLocation object. - /// Find more info here + /// Update the properties of an ipNamedLocation object. + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the properties of a countryNamedLocation object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/countrynamedlocation-update?view=graph-rest-1.0"; + command.Description = "Update the properties of an ipNamedLocation object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/ipnamedlocation-update?view=graph-rest-1.0"; var namedLocationIdOption = new Option("--named-location-id", description: "The unique identifier of namedLocation") { }; namedLocationIdOption.IsRequired = true; @@ -177,7 +177,7 @@ public NamedLocationItemRequestBuilder(string rawUrl) : base("{+baseurl}/identit { } /// - /// Delete a countryNamedLocation object. + /// Delete an ipNamedLocation object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -196,7 +196,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Retrieve the properties and relationships of a namedLocation object. + /// Retrieve the properties and relationships of an ipNamedLocation object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -215,7 +215,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Update the properties of a countryNamedLocation object. + /// Update the properties of an ipNamedLocation object. /// /// A /// The request body @@ -236,7 +236,7 @@ public RequestInformation ToPatchRequestInformation(NamedLocation body, Action - /// Retrieve the properties and relationships of a namedLocation object. + /// Retrieve the properties and relationships of an ipNamedLocation object. /// public class NamedLocationItemRequestBuilderGetQueryParameters { diff --git a/src/generated/Identity/IdentityRequestBuilder.cs b/src/generated/Identity/IdentityRequestBuilder.cs index ce636c5b9a..188f23d65d 100644 --- a/src/generated/Identity/IdentityRequestBuilder.cs +++ b/src/generated/Identity/IdentityRequestBuilder.cs @@ -1,6 +1,7 @@ // using ApiSdk.Identity.ApiConnectors; using ApiSdk.Identity.AuthenticationEventListeners; +using ApiSdk.Identity.AuthenticationEventsFlows; using ApiSdk.Identity.B2xUserFlows; using ApiSdk.Identity.ConditionalAccess; using ApiSdk.Identity.CustomAuthenticationExtensions; @@ -83,6 +84,34 @@ public Command BuildAuthenticationEventListenersNavCommand() return command; } /// + /// Provides operations to manage the authenticationEventsFlows property of the microsoft.graph.identityContainer entity. + /// + /// A + public Command BuildAuthenticationEventsFlowsNavCommand() + { + var command = new Command("authentication-events-flows"); + command.Description = "Provides operations to manage the authenticationEventsFlows property of the microsoft.graph.identityContainer entity."; + var builder = new AuthenticationEventsFlowsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildGraphExternalUsersSelfServiceSignUpEventsFlowNavCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// /// Provides operations to manage the b2xUserFlows property of the microsoft.graph.identityContainer entity. /// /// A diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/AccessPackageItemRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/AccessPackageItemRequestBuilder.cs index d555b05594..08f5929911 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/AccessPackageItemRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AccessPackages/Item/AccessPackageItemRequestBuilder.cs @@ -152,14 +152,14 @@ public Command BuildGetApplicablePolicyRequirementsNavCommand() return command; } /// - /// Retrieve an access package with a list of accessPackageResourceRoleScope objects. These objects represent the resource roles that an access package assigns to each subject. Each object links to an accessPackageResourceRole and an accessPackageResourceScope. - /// Find more info here + /// Retrieve the properties and relationships of an accessPackage object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Retrieve an access package with a list of accessPackageResourceRoleScope objects. These objects represent the resource roles that an access package assigns to each subject. Each object links to an accessPackageResourceRole and an accessPackageResourceScope.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/accesspackage-list-resourcerolescopes?view=graph-rest-1.0"; + command.Description = "Retrieve the properties and relationships of an accessPackage object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/accesspackage-get?view=graph-rest-1.0"; var accessPackageIdOption = new Option("--access-package-id", description: "The unique identifier of accessPackage") { }; accessPackageIdOption.IsRequired = true; @@ -371,7 +371,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Retrieve an access package with a list of accessPackageResourceRoleScope objects. These objects represent the resource roles that an access package assigns to each subject. Each object links to an accessPackageResourceRole and an accessPackageResourceScope. + /// Retrieve the properties and relationships of an accessPackage object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -411,7 +411,7 @@ public RequestInformation ToPatchRequestInformation(ApiSdk.Models.AccessPackage return requestInfo; } /// - /// Retrieve an access package with a list of accessPackageResourceRoleScope objects. These objects represent the resource roles that an access package assigns to each subject. Each object links to an accessPackageResourceRole and an accessPackageResourceScope. + /// Retrieve the properties and relationships of an accessPackage object. /// public class AccessPackageItemRequestBuilderGetQueryParameters { diff --git a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/AssignmentRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/AssignmentRequestBuilder.cs index 972cfd1725..7541a7c93b 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/AssignmentRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/AssignmentRequests/Item/Assignment/AssignmentRequestBuilder.cs @@ -22,13 +22,13 @@ namespace ApiSdk.IdentityGovernance.EntitlementManagement.AssignmentRequests.Ite public class AssignmentRequestBuilder : BaseCliRequestBuilder { /// - /// For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand. + /// For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand."; + command.Description = "For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand."; var accessPackageAssignmentRequestIdOption = new Option("--access-package-assignment-request-id", description: "The unique identifier of accessPackageAssignmentRequest") { }; accessPackageAssignmentRequestIdOption.IsRequired = true; @@ -88,7 +88,7 @@ public AssignmentRequestBuilder(string rawUrl) : base("{+baseurl}/identityGovern { } /// - /// For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand. + /// For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -107,7 +107,7 @@ public RequestInformation ToGetRequestInformation(Action - /// For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand. + /// For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand. /// public class AssignmentRequestBuilderGetQueryParameters { diff --git a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/CustomWorkflowExtensions/Item/CustomCalloutExtensionItemRequestBuilder.cs b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/CustomWorkflowExtensions/Item/CustomCalloutExtensionItemRequestBuilder.cs index 3d07608e55..d285ff2a82 100644 --- a/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/CustomWorkflowExtensions/Item/CustomCalloutExtensionItemRequestBuilder.cs +++ b/src/generated/IdentityGovernance/EntitlementManagement/Catalogs/Item/CustomWorkflowExtensions/Item/CustomCalloutExtensionItemRequestBuilder.cs @@ -22,14 +22,14 @@ namespace ApiSdk.IdentityGovernance.EntitlementManagement.Catalogs.Item.CustomWo public class CustomCalloutExtensionItemRequestBuilder : BaseCliRequestBuilder { /// - /// Delete an accessPackageAssignmentRequestWorkflowExtension object. The custom workflow extension must first be removed from any associated policies before it can be deleted. Follow these steps to remove the custom workflow extension from any associated policies: - /// Find more info here + /// Delete an accessPackageAssignmentWorkflowExtension object. The custom workflow extension must first be removed from any associated policies before it can be deleted. Follow these steps to remove the custom workflow extension from any associated policies: + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete an accessPackageAssignmentRequestWorkflowExtension object. The custom workflow extension must first be removed from any associated policies before it can be deleted. Follow these steps to remove the custom workflow extension from any associated policies:\n\nFind more info here:\n https://learn.microsoft.com/graph/api/accesspackageassignmentrequestworkflowextension-delete?view=graph-rest-1.0"; + command.Description = "Delete an accessPackageAssignmentWorkflowExtension object. The custom workflow extension must first be removed from any associated policies before it can be deleted. Follow these steps to remove the custom workflow extension from any associated policies:\n\nFind more info here:\n https://learn.microsoft.com/graph/api/accesspackageassignmentworkflowextension-delete?view=graph-rest-1.0"; var accessPackageCatalogIdOption = new Option("--access-package-catalog-id", description: "The unique identifier of accessPackageCatalog") { }; accessPackageCatalogIdOption.IsRequired = true; @@ -64,14 +64,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Read the properties and relationships of an accessPackageAssignmentWorkflowExtension object. - /// Find more info here + /// Read the properties and relationships of an accessPackageAssignmentRequestWorkflowExtension object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read the properties and relationships of an accessPackageAssignmentWorkflowExtension object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/accesspackageassignmentworkflowextension-get?view=graph-rest-1.0"; + command.Description = "Read the properties and relationships of an accessPackageAssignmentRequestWorkflowExtension object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/accesspackageassignmentrequestworkflowextension-get?view=graph-rest-1.0"; var accessPackageCatalogIdOption = new Option("--access-package-catalog-id", description: "The unique identifier of accessPackageCatalog") { }; accessPackageCatalogIdOption.IsRequired = true; @@ -123,14 +123,14 @@ public Command BuildGetCommand() return command; } /// - /// Update the properties of an accessPackageAssignmentWorkflowExtension object. - /// Find more info here + /// Update the properties of an accessPackageAssignmentRequestWorkflowExtension object. + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the properties of an accessPackageAssignmentWorkflowExtension object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/accesspackageassignmentworkflowextension-update?view=graph-rest-1.0"; + command.Description = "Update the properties of an accessPackageAssignmentRequestWorkflowExtension object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/accesspackageassignmentrequestworkflowextension-update?view=graph-rest-1.0"; var accessPackageCatalogIdOption = new Option("--access-package-catalog-id", description: "The unique identifier of accessPackageCatalog") { }; accessPackageCatalogIdOption.IsRequired = true; @@ -195,7 +195,7 @@ public CustomCalloutExtensionItemRequestBuilder(string rawUrl) : base("{+baseurl { } /// - /// Delete an accessPackageAssignmentRequestWorkflowExtension object. The custom workflow extension must first be removed from any associated policies before it can be deleted. Follow these steps to remove the custom workflow extension from any associated policies: + /// Delete an accessPackageAssignmentWorkflowExtension object. The custom workflow extension must first be removed from any associated policies before it can be deleted. Follow these steps to remove the custom workflow extension from any associated policies: /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -214,7 +214,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read the properties and relationships of an accessPackageAssignmentWorkflowExtension object. + /// Read the properties and relationships of an accessPackageAssignmentRequestWorkflowExtension object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -233,7 +233,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Update the properties of an accessPackageAssignmentWorkflowExtension object. + /// Update the properties of an accessPackageAssignmentRequestWorkflowExtension object. /// /// A /// The request body @@ -254,7 +254,7 @@ public RequestInformation ToPatchRequestInformation(CustomCalloutExtension body, return requestInfo; } /// - /// Read the properties and relationships of an accessPackageAssignmentWorkflowExtension object. + /// Read the properties and relationships of an accessPackageAssignmentRequestWorkflowExtension object. /// public class CustomCalloutExtensionItemRequestBuilderGetQueryParameters { diff --git a/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/Runs/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/Runs/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs index bda75ed26b..6e25c3acba 100644 --- a/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/Runs/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/Runs/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -37,11 +37,11 @@ public Command BuildGetCommand() }; runIdOption.IsRequired = true; command.AddOption(runIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/Runs/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/Runs/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs index 09214c012c..1ca7448465 100644 --- a/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/Runs/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/Runs/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -33,11 +33,11 @@ public Command BuildGetCommand() }; workflowIdOption.IsRequired = true; command.AddOption(workflowIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/TaskReports/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/TaskReports/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs index e783fdd4de..1e39f48dc1 100644 --- a/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/TaskReports/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/TaskReports/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -33,11 +33,11 @@ public Command BuildGetCommand() }; workflowIdOption.IsRequired = true; command.AddOption(workflowIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs index 3d1a828e9e..0d1c831a07 100644 --- a/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/IdentityGovernance/LifecycleWorkflows/DeletedItems/Workflows/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -33,11 +33,11 @@ public Command BuildGetCommand() }; workflowIdOption.IsRequired = true; command.AddOption(workflowIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/Runs/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/Runs/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs index 5b8cb0aeef..4c1e135663 100644 --- a/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/Runs/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/Runs/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -37,11 +37,11 @@ public Command BuildGetCommand() }; runIdOption.IsRequired = true; command.AddOption(runIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/Runs/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/Runs/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs index b1fa3cc8e5..d49b88d156 100644 --- a/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/Runs/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/Runs/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -33,11 +33,11 @@ public Command BuildGetCommand() }; workflowIdOption.IsRequired = true; command.AddOption(workflowIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/TaskReports/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/TaskReports/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs index 55cd61231f..a2248899cd 100644 --- a/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/TaskReports/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/TaskReports/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -33,11 +33,11 @@ public Command BuildGetCommand() }; workflowIdOption.IsRequired = true; command.AddOption(workflowIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs index b2e7e73b8c..22602cca08 100644 --- a/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/IdentityGovernance/LifecycleWorkflows/Workflows/Item/UserProcessingResults/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTime/MicrosoftGraphIdentityGovernanceSummaryWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -33,11 +33,11 @@ public Command BuildGetCommand() }; workflowIdOption.IsRequired = true; command.AddOption(workflowIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/Models/AccessPackageAssignment.cs b/src/generated/Models/AccessPackageAssignment.cs index 9a45e8a58c..0a5f59bc04 100644 --- a/src/generated/Models/AccessPackageAssignment.cs +++ b/src/generated/Models/AccessPackageAssignment.cs @@ -46,7 +46,7 @@ public class AccessPackageAssignment : Entity, IParsable #endif /// The state of the access package assignment. The possible values are: delivering, partiallyDelivered, delivered, expired, deliveryFailed, unknownFutureValue. Read-only. Supports $filter (eq). public AccessPackageAssignmentState? State { get; set; } - /// More information about the assignment lifecycle. Possible values include Delivering, Delivered, NearExpiry1DayNotificationTriggered, or ExpiredNotificationTriggered. Read-only. + /// More information about the assignment lifecycle. Possible values include Delivering, Delivered, NearExpiry1DayNotificationTriggered, or ExpiredNotificationTriggered. Read-only. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public string? Status { get; set; } diff --git a/src/generated/Models/AccessPackageAssignmentRequest.cs b/src/generated/Models/AccessPackageAssignmentRequest.cs index af732d0fa1..41293735d6 100644 --- a/src/generated/Models/AccessPackageAssignmentRequest.cs +++ b/src/generated/Models/AccessPackageAssignmentRequest.cs @@ -26,7 +26,7 @@ public class AccessPackageAssignmentRequest : Entity, IParsable #else public List Answers { get; set; } #endif - /// For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand. + /// For a requestType of userAdd or adminAdd, this is an access package assignment requested to be created. For a requestType of userRemove, adminRemove or systemRemove, this has the id property of an existing assignment to be removed. Supports $expand. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public AccessPackageAssignment? Assignment { get; set; } @@ -54,7 +54,7 @@ public class AccessPackageAssignmentRequest : Entity, IParsable #else public AccessPackageSubject Requestor { get; set; } #endif - /// The type of the request. The possible values are: notSpecified, userAdd, UserExtend, userUpdate, userRemove, adminAdd, adminUpdate, adminRemove, systemAdd, systemUpdate, systemRemove, onBehalfAdd (not supported), unknownFutureValue. A request from the user themselves would have requestType of userAdd, userUpdate or userRemove. This property can't be changed once set. + /// The type of the request. The possible values are: notSpecified, userAdd, UserExtend, userUpdate, userRemove, adminAdd, adminUpdate, adminRemove, systemAdd, systemUpdate, systemRemove, onBehalfAdd (not supported), unknownFutureValue. Requests from the user have a requestType of userAdd, userUpdate, or userRemove. This property can't be changed once set. public AccessPackageRequestType? RequestType { get; set; } /// The range of dates that access is to be assigned to the requestor. This property can't be changed once set. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER diff --git a/src/generated/Models/AccessPackageResource.cs b/src/generated/Models/AccessPackageResource.cs index 7455165c79..94b305c11f 100644 --- a/src/generated/Models/AccessPackageResource.cs +++ b/src/generated/Models/AccessPackageResource.cs @@ -46,7 +46,7 @@ public class AccessPackageResource : Entity, IParsable #endif /// The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. public DateTimeOffset? ModifiedDateTime { get; set; } - /// The unique identifier of the resource in the origin system. In the case of a Microsoft Entra group, this is the identifier of the group. + /// The unique identifier of the resource in the origin system. For a Microsoft Entra group, this is the identifier of the group. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public string? OriginId { get; set; } diff --git a/src/generated/Models/AccessPackageResourceRequest.cs b/src/generated/Models/AccessPackageResourceRequest.cs index fcaf833d0e..327bfb40b7 100644 --- a/src/generated/Models/AccessPackageResourceRequest.cs +++ b/src/generated/Models/AccessPackageResourceRequest.cs @@ -30,7 +30,7 @@ public class AccessPackageResourceRequest : Entity, IParsable #else public AccessPackageResource Resource { get; set; } #endif - /// The outcome of whether the service was able to add the resource to the catalog. The value is delivered if the resource was added or removed, and deliveryFailed if it could not be added or removed. Read-only. + /// The outcome of whether the service was able to add the resource to the catalog. The value is delivered if the resource was added or removed, and deliveryFailed if it couldn't be added or removed. Read-only. public AccessPackageRequestState? State { get; set; } /// /// Creates a new instance of the appropriate class based on discriminator value diff --git a/src/generated/Models/AccessPackageResourceRole.cs b/src/generated/Models/AccessPackageResourceRole.cs index 9068c4bff0..52f6715207 100644 --- a/src/generated/Models/AccessPackageResourceRole.cs +++ b/src/generated/Models/AccessPackageResourceRole.cs @@ -26,7 +26,7 @@ public class AccessPackageResourceRole : Entity, IParsable #else public string DisplayName { get; set; } #endif - /// The unique identifier of the resource role in the origin system. For a SharePoint Online site, the originId will be the sequence number of the role in the site. + /// The unique identifier of the resource role in the origin system. For a SharePoint Online site, the originId is the sequence number of the role in the site. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public string? OriginId { get; set; } @@ -34,7 +34,7 @@ public class AccessPackageResourceRole : Entity, IParsable #else public string OriginId { get; set; } #endif - /// The type of the resource in the origin system, such as SharePointOnline, AadApplication or AadGroup. + /// The type of the resource in the origin system, such as SharePointOnline, AadApplication, or AadGroup. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public string? OriginSystem { get; set; } diff --git a/src/generated/Models/AccessReviewInstanceDecisionItem.cs b/src/generated/Models/AccessReviewInstanceDecisionItem.cs index dce1cf7dd5..04618a4747 100644 --- a/src/generated/Models/AccessReviewInstanceDecisionItem.cs +++ b/src/generated/Models/AccessReviewInstanceDecisionItem.cs @@ -76,7 +76,7 @@ public class AccessReviewInstanceDecisionItem : Entity, IParsable #else public string PrincipalLink { get; set; } #endif - /// A system-generated recommendation for the approval decision based off last interactive sign-in to tenant. Recommend approve if sign-in is within thirty days of start of review. Recommend deny if sign-in is greater than thirty days of start of review. Recommendation not available otherwise. Possible values: Approve, Deny, or NoInfoAvailable. Supports $select, $orderby, and $filter (eq only). Read-only. + /// A system-generated recommendation for the approval decision based off last interactive sign-in to tenant. The value is Approve if the sign-in is fewer than 30 days after the start of review, Deny if the sign-in is greater than 30 days after, or NoInfoAvailable. Possible values: Approve, Deny, or NoInfoAvailable. Supports $select, $orderby, and $filter (eq only). Read-only. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public string? Recommendation { get; set; } diff --git a/src/generated/Models/Authentication.cs b/src/generated/Models/Authentication.cs index b0eb4afe7c..6e2263f4f3 100644 --- a/src/generated/Models/Authentication.cs +++ b/src/generated/Models/Authentication.cs @@ -50,7 +50,7 @@ public class Authentication : Entity, IParsable #else public List Operations { get; set; } #endif - /// Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password. + /// Represents the password registered to a user for authentication. For security, the password itself is never returned in the object, but action can be taken to reset a password. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public List? PasswordMethods { get; set; } @@ -66,7 +66,7 @@ public class Authentication : Entity, IParsable #else public List PhoneMethods { get; set; } #endif - /// The software OATH TOTP applications registered to a user for authentication. + /// The software OATH time-based one-time password (TOTP) applications registered to a user for authentication. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public List? SoftwareOathMethods { get; set; } diff --git a/src/generated/Models/AuthenticationAttributeCollectionInputConfiguration.cs b/src/generated/Models/AuthenticationAttributeCollectionInputConfiguration.cs new file mode 100644 index 0000000000..2ab7f8e1d4 --- /dev/null +++ b/src/generated/Models/AuthenticationAttributeCollectionInputConfiguration.cs @@ -0,0 +1,132 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class AuthenticationAttributeCollectionInputConfiguration : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The built-in or custom attribute for which a value is being collected. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Attribute { get; set; } +#nullable restore +#else + public string Attribute { get; set; } +#endif + /// The default value of the attribute displayed to the end user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DefaultValue { get; set; } +#nullable restore +#else + public string DefaultValue { get; set; } +#endif + /// Whether the attribute is editable by the end user. + public bool? Editable { get; set; } + /// Whether the attribute is displayed to the end user. + public bool? Hidden { get; set; } + /// The inputType property + public AuthenticationAttributeCollectionInputType? InputType { get; set; } + /// The label of the attribute field that is displayed to end user, unless overridden. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Label { get; set; } +#nullable restore +#else + public string Label { get; set; } +#endif + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// The option values for certain multiple-option input types. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Options { get; set; } +#nullable restore +#else + public List Options { get; set; } +#endif + /// Whether the field is required. + public bool? Required { get; set; } + /// The regex for the value of the field. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ValidationRegEx { get; set; } +#nullable restore +#else + public string ValidationRegEx { get; set; } +#endif + /// Whether the value collected is stored. + public bool? WriteToDirectory { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public AuthenticationAttributeCollectionInputConfiguration() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AuthenticationAttributeCollectionInputConfiguration CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticationAttributeCollectionInputConfiguration(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "attribute", n => { Attribute = n.GetStringValue(); } }, + { "defaultValue", n => { DefaultValue = n.GetStringValue(); } }, + { "editable", n => { Editable = n.GetBoolValue(); } }, + { "hidden", n => { Hidden = n.GetBoolValue(); } }, + { "inputType", n => { InputType = n.GetEnumValue(); } }, + { "label", n => { Label = n.GetStringValue(); } }, + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + { "options", n => { Options = n.GetCollectionOfObjectValues(AuthenticationAttributeCollectionOptionConfiguration.CreateFromDiscriminatorValue)?.ToList(); } }, + { "required", n => { Required = n.GetBoolValue(); } }, + { "validationRegEx", n => { ValidationRegEx = n.GetStringValue(); } }, + { "writeToDirectory", n => { WriteToDirectory = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("attribute", Attribute); + writer.WriteStringValue("defaultValue", DefaultValue); + writer.WriteBoolValue("editable", Editable); + writer.WriteBoolValue("hidden", Hidden); + writer.WriteEnumValue("inputType", InputType); + writer.WriteStringValue("label", Label); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteCollectionOfObjectValues("options", Options); + writer.WriteBoolValue("required", Required); + writer.WriteStringValue("validationRegEx", ValidationRegEx); + writer.WriteBoolValue("writeToDirectory", WriteToDirectory); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/AuthenticationAttributeCollectionInputType.cs b/src/generated/Models/AuthenticationAttributeCollectionInputType.cs new file mode 100644 index 0000000000..7065cfabdd --- /dev/null +++ b/src/generated/Models/AuthenticationAttributeCollectionInputType.cs @@ -0,0 +1,31 @@ +// +using System.Runtime.Serialization; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public enum AuthenticationAttributeCollectionInputType + #pragma warning restore CS1591 + { + [EnumMember(Value = "text")] + #pragma warning disable CS1591 + Text, + #pragma warning restore CS1591 + [EnumMember(Value = "radioSingleSelect")] + #pragma warning disable CS1591 + RadioSingleSelect, + #pragma warning restore CS1591 + [EnumMember(Value = "checkboxMultiSelect")] + #pragma warning disable CS1591 + CheckboxMultiSelect, + #pragma warning restore CS1591 + [EnumMember(Value = "boolean")] + #pragma warning disable CS1591 + Boolean, + #pragma warning restore CS1591 + [EnumMember(Value = "unknownFutureValue")] + #pragma warning disable CS1591 + UnknownFutureValue, + #pragma warning restore CS1591 + } +} diff --git a/src/generated/Models/AuthenticationAttributeCollectionOptionConfiguration.cs b/src/generated/Models/AuthenticationAttributeCollectionOptionConfiguration.cs new file mode 100644 index 0000000000..3ee6eab0ab --- /dev/null +++ b/src/generated/Models/AuthenticationAttributeCollectionOptionConfiguration.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class AuthenticationAttributeCollectionOptionConfiguration : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The label of the option that will be displayed to user, unless overridden. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Label { get; set; } +#nullable restore +#else + public string Label { get; set; } +#endif + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// The value of the option that will be stored. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AuthenticationAttributeCollectionOptionConfiguration() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AuthenticationAttributeCollectionOptionConfiguration CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticationAttributeCollectionOptionConfiguration(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "label", n => { Label = n.GetStringValue(); } }, + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("label", Label); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/AuthenticationAttributeCollectionPage.cs b/src/generated/Models/AuthenticationAttributeCollectionPage.cs new file mode 100644 index 0000000000..459545b4c6 --- /dev/null +++ b/src/generated/Models/AuthenticationAttributeCollectionPage.cs @@ -0,0 +1,72 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class AuthenticationAttributeCollectionPage : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// A collection of displays of the attribute collection page. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Views { get; set; } +#nullable restore +#else + public List Views { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AuthenticationAttributeCollectionPage() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AuthenticationAttributeCollectionPage CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticationAttributeCollectionPage(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + { "views", n => { Views = n.GetCollectionOfObjectValues(AuthenticationAttributeCollectionPageViewConfiguration.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteCollectionOfObjectValues("views", Views); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/AuthenticationAttributeCollectionPageViewConfiguration.cs b/src/generated/Models/AuthenticationAttributeCollectionPageViewConfiguration.cs new file mode 100644 index 0000000000..9bf7b07d06 --- /dev/null +++ b/src/generated/Models/AuthenticationAttributeCollectionPageViewConfiguration.cs @@ -0,0 +1,92 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class AuthenticationAttributeCollectionPageViewConfiguration : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The description of the page. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The display configuration of attributes being collected on the attribute collection page. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Inputs { get; set; } +#nullable restore +#else + public List Inputs { get; set; } +#endif + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// The title of the attribute collection page. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Title { get; set; } +#nullable restore +#else + public string Title { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AuthenticationAttributeCollectionPageViewConfiguration() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AuthenticationAttributeCollectionPageViewConfiguration CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticationAttributeCollectionPageViewConfiguration(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "description", n => { Description = n.GetStringValue(); } }, + { "inputs", n => { Inputs = n.GetCollectionOfObjectValues(AuthenticationAttributeCollectionInputConfiguration.CreateFromDiscriminatorValue)?.ToList(); } }, + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteCollectionOfObjectValues("inputs", Inputs); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteStringValue("title", Title); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/AuthenticationConditionApplicationCollectionResponse.cs b/src/generated/Models/AuthenticationConditionApplicationCollectionResponse.cs new file mode 100644 index 0000000000..7c86412ef6 --- /dev/null +++ b/src/generated/Models/AuthenticationConditionApplicationCollectionResponse.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class AuthenticationConditionApplicationCollectionResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new AuthenticationConditionApplicationCollectionResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticationConditionApplicationCollectionResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(AuthenticationConditionApplication.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Models/AuthenticationEventListener.cs b/src/generated/Models/AuthenticationEventListener.cs index b3014047c3..47d4b603d5 100644 --- a/src/generated/Models/AuthenticationEventListener.cs +++ b/src/generated/Models/AuthenticationEventListener.cs @@ -37,7 +37,11 @@ public class AuthenticationEventListener : Entity, IParsable var mappingValue = parseNode.GetChildNode("@odata.type")?.GetStringValue(); return mappingValue switch { + "#microsoft.graph.onAttributeCollectionListener" => new OnAttributeCollectionListener(), + "#microsoft.graph.onAuthenticationMethodLoadStartListener" => new OnAuthenticationMethodLoadStartListener(), + "#microsoft.graph.onInteractiveAuthFlowStartListener" => new OnInteractiveAuthFlowStartListener(), "#microsoft.graph.onTokenIssuanceStartListener" => new OnTokenIssuanceStartListener(), + "#microsoft.graph.onUserCreateStartListener" => new OnUserCreateStartListener(), _ => new AuthenticationEventListener(), }; } diff --git a/src/generated/Models/AuthenticationEventsFlow.cs b/src/generated/Models/AuthenticationEventsFlow.cs new file mode 100644 index 0000000000..c110bca09d --- /dev/null +++ b/src/generated/Models/AuthenticationEventsFlow.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class AuthenticationEventsFlow : Entity, IParsable + #pragma warning restore CS1591 + { + /// The conditions representing the context of the authentication request that's used to decide whether the events policy is invoked. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public AuthenticationConditions? Conditions { get; set; } +#nullable restore +#else + public AuthenticationConditions Conditions { get; set; } +#endif + /// The description of the events policy. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// Required. The display name for the events policy. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DisplayName { get; set; } +#nullable restore +#else + public string DisplayName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new AuthenticationEventsFlow CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("@odata.type")?.GetStringValue(); + return mappingValue switch + { + "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow" => new ExternalUsersSelfServiceSignUpEventsFlow(), + _ => new AuthenticationEventsFlow(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "conditions", n => { Conditions = n.GetObjectValue(AuthenticationConditions.CreateFromDiscriminatorValue); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "displayName", n => { DisplayName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("conditions", Conditions); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("displayName", DisplayName); + } + } +} diff --git a/src/generated/Models/AuthenticationEventsFlowCollectionResponse.cs b/src/generated/Models/AuthenticationEventsFlowCollectionResponse.cs new file mode 100644 index 0000000000..a158fe82c3 --- /dev/null +++ b/src/generated/Models/AuthenticationEventsFlowCollectionResponse.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class AuthenticationEventsFlowCollectionResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new AuthenticationEventsFlowCollectionResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticationEventsFlowCollectionResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(AuthenticationEventsFlow.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Models/ContentCustomization.cs b/src/generated/Models/ContentCustomization.cs index 4e434705b7..22eb69e5ac 100644 --- a/src/generated/Models/ContentCustomization.cs +++ b/src/generated/Models/ContentCustomization.cs @@ -36,7 +36,7 @@ public class ContentCustomization : IAdditionalDataHolder, IParsable #else public string OdataType { get; set; } #endif - /// The registrationCampaign property + /// Represents content options to customize during MFA proofup interruptions. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public List? RegistrationCampaign { get; set; } @@ -44,7 +44,7 @@ public class ContentCustomization : IAdditionalDataHolder, IParsable #else public List RegistrationCampaign { get; set; } #endif - /// The registrationCampaignRelativeUrl property + /// The relative URL of the content options to customize during MFA proofup interruptions. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public string? RegistrationCampaignRelativeUrl { get; set; } diff --git a/src/generated/Models/Dictionary.cs b/src/generated/Models/Dictionary.cs index 281e84f144..50512fc7e8 100644 --- a/src/generated/Models/Dictionary.cs +++ b/src/generated/Models/Dictionary.cs @@ -38,6 +38,7 @@ public static Dictionary CreateFromDiscriminatorValue(IParseNode parseNode) var mappingValue = parseNode.GetChildNode("@odata.type")?.GetStringValue(); return mappingValue switch { + "#microsoft.graph.fileStorageContainerCustomPropertyDictionary" => new FileStorageContainerCustomPropertyDictionary(), "#microsoft.graph.resultTemplateDictionary" => new ResultTemplateDictionary(), _ => new Dictionary(), }; diff --git a/src/generated/Models/Entity.cs b/src/generated/Models/Entity.cs index f019ea724f..a889d35ccc 100644 --- a/src/generated/Models/Entity.cs +++ b/src/generated/Models/Entity.cs @@ -135,6 +135,7 @@ public static Entity CreateFromDiscriminatorValue(IParseNode parseNode) "#microsoft.graph.authenticationCombinationConfiguration" => new AuthenticationCombinationConfiguration(), "#microsoft.graph.authenticationContextClassReference" => new AuthenticationContextClassReference(), "#microsoft.graph.authenticationEventListener" => new AuthenticationEventListener(), + "#microsoft.graph.authenticationEventsFlow" => new AuthenticationEventsFlow(), "#microsoft.graph.authenticationFlowsPolicy" => new AuthenticationFlowsPolicy(), "#microsoft.graph.authenticationMethod" => new AuthenticationMethod(), "#microsoft.graph.authenticationMethodConfiguration" => new AuthenticationMethodConfiguration(), @@ -345,6 +346,7 @@ public static Entity CreateFromDiscriminatorValue(IParseNode parseNode) "#microsoft.graph.externalConnectors.identity" => new ApiSdk.Models.ExternalConnectors.Identity(), "#microsoft.graph.externalConnectors.schema" => new ApiSdk.Models.ExternalConnectors.Schema(), "#microsoft.graph.externalDomainName" => new ExternalDomainName(), + "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow" => new ExternalUsersSelfServiceSignUpEventsFlow(), "#microsoft.graph.featureRolloutPolicy" => new FeatureRolloutPolicy(), "#microsoft.graph.federatedIdentityCredential" => new FederatedIdentityCredential(), "#microsoft.graph.fido2AuthenticationMethod" => new Fido2AuthenticationMethod(), @@ -353,6 +355,8 @@ public static Entity CreateFromDiscriminatorValue(IParseNode parseNode) "#microsoft.graph.fieldValueSet" => new FieldValueSet(), "#microsoft.graph.fileAssessmentRequest" => new FileAssessmentRequest(), "#microsoft.graph.fileAttachment" => new FileAttachment(), + "#microsoft.graph.fileStorage" => new FileStorage(), + "#microsoft.graph.fileStorageContainer" => new FileStorageContainer(), "#microsoft.graph.filterOperatorSchema" => new FilterOperatorSchema(), "#microsoft.graph.governanceInsight" => new GovernanceInsight(), "#microsoft.graph.group" => new Group(), @@ -499,6 +503,8 @@ public static Entity CreateFromDiscriminatorValue(IParseNode parseNode) "#microsoft.graph.oAuth2PermissionGrant" => new OAuth2PermissionGrant(), "#microsoft.graph.offerShiftRequest" => new OfferShiftRequest(), "#microsoft.graph.officeGraphInsights" => new OfficeGraphInsights(), + "#microsoft.graph.onAttributeCollectionListener" => new OnAttributeCollectionListener(), + "#microsoft.graph.onAuthenticationMethodLoadStartListener" => new OnAuthenticationMethodLoadStartListener(), "#microsoft.graph.onenote" => new Onenote(), "#microsoft.graph.onenoteEntityBaseModel" => new OnenoteEntityBaseModel(), "#microsoft.graph.onenoteEntityHierarchyModel" => new OnenoteEntityHierarchyModel(), @@ -507,12 +513,14 @@ public static Entity CreateFromDiscriminatorValue(IParseNode parseNode) "#microsoft.graph.onenotePage" => new OnenotePage(), "#microsoft.graph.onenoteResource" => new OnenoteResource(), "#microsoft.graph.onenoteSection" => new OnenoteSection(), + "#microsoft.graph.onInteractiveAuthFlowStartListener" => new OnInteractiveAuthFlowStartListener(), "#microsoft.graph.onlineMeeting" => new OnlineMeeting(), "#microsoft.graph.onlineMeetingBase" => new OnlineMeetingBase(), "#microsoft.graph.onPremisesConditionalAccessSettings" => new OnPremisesConditionalAccessSettings(), "#microsoft.graph.onPremisesDirectorySynchronization" => new OnPremisesDirectorySynchronization(), "#microsoft.graph.onTokenIssuanceStartCustomExtension" => new OnTokenIssuanceStartCustomExtension(), "#microsoft.graph.onTokenIssuanceStartListener" => new OnTokenIssuanceStartListener(), + "#microsoft.graph.onUserCreateStartListener" => new OnUserCreateStartListener(), "#microsoft.graph.openShift" => new OpenShift(), "#microsoft.graph.openShiftChangeRequest" => new OpenShiftChangeRequest(), "#microsoft.graph.openTypeExtension" => new OpenTypeExtension(), diff --git a/src/generated/Models/ExternalUsersSelfServiceSignUpEventsFlow.cs b/src/generated/Models/ExternalUsersSelfServiceSignUpEventsFlow.cs new file mode 100644 index 0000000000..e9f4e262e3 --- /dev/null +++ b/src/generated/Models/ExternalUsersSelfServiceSignUpEventsFlow.cs @@ -0,0 +1,90 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class ExternalUsersSelfServiceSignUpEventsFlow : AuthenticationEventsFlow, IParsable + #pragma warning restore CS1591 + { + /// The configuration for what to invoke when attributes are ready to be collected from the user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OnAttributeCollectionHandler? OnAttributeCollection { get; set; } +#nullable restore +#else + public OnAttributeCollectionHandler OnAttributeCollection { get; set; } +#endif + /// Required. The configuration for what to invoke when authentication methods are ready to be presented to the user. Must have at least one identity provider linked. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OnAuthenticationMethodLoadStartHandler? OnAuthenticationMethodLoadStart { get; set; } +#nullable restore +#else + public OnAuthenticationMethodLoadStartHandler OnAuthenticationMethodLoadStart { get; set; } +#endif + /// Required. The configuration for what to invoke when an authentication flow is ready to be initiated. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OnInteractiveAuthFlowStartHandler? OnInteractiveAuthFlowStart { get; set; } +#nullable restore +#else + public OnInteractiveAuthFlowStartHandler OnInteractiveAuthFlowStart { get; set; } +#endif + /// The configuration for what to invoke during user creation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OnUserCreateStartHandler? OnUserCreateStart { get; set; } +#nullable restore +#else + public OnUserCreateStartHandler OnUserCreateStart { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ExternalUsersSelfServiceSignUpEventsFlow() : base() + { + OdataType = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new ExternalUsersSelfServiceSignUpEventsFlow CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExternalUsersSelfServiceSignUpEventsFlow(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "onAttributeCollection", n => { OnAttributeCollection = n.GetObjectValue(OnAttributeCollectionHandler.CreateFromDiscriminatorValue); } }, + { "onAuthenticationMethodLoadStart", n => { OnAuthenticationMethodLoadStart = n.GetObjectValue(OnAuthenticationMethodLoadStartHandler.CreateFromDiscriminatorValue); } }, + { "onInteractiveAuthFlowStart", n => { OnInteractiveAuthFlowStart = n.GetObjectValue(OnInteractiveAuthFlowStartHandler.CreateFromDiscriminatorValue); } }, + { "onUserCreateStart", n => { OnUserCreateStart = n.GetObjectValue(OnUserCreateStartHandler.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("onAttributeCollection", OnAttributeCollection); + writer.WriteObjectValue("onAuthenticationMethodLoadStart", OnAuthenticationMethodLoadStart); + writer.WriteObjectValue("onInteractiveAuthFlowStart", OnInteractiveAuthFlowStart); + writer.WriteObjectValue("onUserCreateStart", OnUserCreateStart); + } + } +} diff --git a/src/generated/Models/ExternalUsersSelfServiceSignUpEventsFlowCollectionResponse.cs b/src/generated/Models/ExternalUsersSelfServiceSignUpEventsFlowCollectionResponse.cs new file mode 100644 index 0000000000..3b417d7c07 --- /dev/null +++ b/src/generated/Models/ExternalUsersSelfServiceSignUpEventsFlowCollectionResponse.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class ExternalUsersSelfServiceSignUpEventsFlowCollectionResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new ExternalUsersSelfServiceSignUpEventsFlowCollectionResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExternalUsersSelfServiceSignUpEventsFlowCollectionResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ExternalUsersSelfServiceSignUpEventsFlow.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Models/FileStorage.cs b/src/generated/Models/FileStorage.cs new file mode 100644 index 0000000000..80e73c4fbd --- /dev/null +++ b/src/generated/Models/FileStorage.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class FileStorage : Entity, IParsable + #pragma warning restore CS1591 + { + /// The containers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Containers { get; set; } +#nullable restore +#else + public List Containers { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new FileStorage CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FileStorage(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "containers", n => { Containers = n.GetCollectionOfObjectValues(FileStorageContainer.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("containers", Containers); + } + } +} diff --git a/src/generated/Models/FileStorageContainer.cs b/src/generated/Models/FileStorageContainer.cs new file mode 100644 index 0000000000..5fd480f2f5 --- /dev/null +++ b/src/generated/Models/FileStorageContainer.cs @@ -0,0 +1,115 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class FileStorageContainer : Entity, IParsable + #pragma warning restore CS1591 + { + /// Container type ID of the fileStorageContainer. For details about container types, see Container Types. Each container must have only one container type. Read-only. + public Guid? ContainerTypeId { get; set; } + /// Date and time of the fileStorageContainer creation. Read-only. + public DateTimeOffset? CreatedDateTime { get; set; } + /// Custom property collection for the fileStorageContainer. Read-write. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FileStorageContainerCustomPropertyDictionary? CustomProperties { get; set; } +#nullable restore +#else + public FileStorageContainerCustomPropertyDictionary CustomProperties { get; set; } +#endif + /// Provides a user-visible description of the fileStorageContainer. Read-write. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// The display name of the fileStorageContainer. Read-write. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DisplayName { get; set; } +#nullable restore +#else + public string DisplayName { get; set; } +#endif + /// The drive of the resource fileStorageContainer. Read-only. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ApiSdk.Models.Drive? Drive { get; set; } +#nullable restore +#else + public ApiSdk.Models.Drive Drive { get; set; } +#endif + /// The set of permissions for users in the fileStorageContainer. Permission for each user is set by the roles property. The possible values are 'reader', 'writer', 'manager', and 'owner'. Read-write. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Permissions { get; set; } +#nullable restore +#else + public List Permissions { get; set; } +#endif + /// Status of the fileStorageContainer. Containers are created as inactive and require activation. Inactive containers are subjected to automatic deletion in 24 hours. The possible values are: inactive, active. Read-only. + public FileStorageContainerStatus? Status { get; set; } + /// Data specific to the current user. Read-only. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public FileStorageContainerViewpoint? Viewpoint { get; set; } +#nullable restore +#else + public FileStorageContainerViewpoint Viewpoint { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new FileStorageContainer CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FileStorageContainer(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "containerTypeId", n => { ContainerTypeId = n.GetGuidValue(); } }, + { "createdDateTime", n => { CreatedDateTime = n.GetDateTimeOffsetValue(); } }, + { "customProperties", n => { CustomProperties = n.GetObjectValue(FileStorageContainerCustomPropertyDictionary.CreateFromDiscriminatorValue); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "displayName", n => { DisplayName = n.GetStringValue(); } }, + { "drive", n => { Drive = n.GetObjectValue(ApiSdk.Models.Drive.CreateFromDiscriminatorValue); } }, + { "permissions", n => { Permissions = n.GetCollectionOfObjectValues(Permission.CreateFromDiscriminatorValue)?.ToList(); } }, + { "status", n => { Status = n.GetEnumValue(); } }, + { "viewpoint", n => { Viewpoint = n.GetObjectValue(FileStorageContainerViewpoint.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteGuidValue("containerTypeId", ContainerTypeId); + writer.WriteDateTimeOffsetValue("createdDateTime", CreatedDateTime); + writer.WriteObjectValue("customProperties", CustomProperties); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("displayName", DisplayName); + writer.WriteObjectValue("drive", Drive); + writer.WriteCollectionOfObjectValues("permissions", Permissions); + writer.WriteEnumValue("status", Status); + writer.WriteObjectValue("viewpoint", Viewpoint); + } + } +} diff --git a/src/generated/Models/FileStorageContainerCollectionResponse.cs b/src/generated/Models/FileStorageContainerCollectionResponse.cs new file mode 100644 index 0000000000..6916b181c0 --- /dev/null +++ b/src/generated/Models/FileStorageContainerCollectionResponse.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class FileStorageContainerCollectionResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new FileStorageContainerCollectionResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FileStorageContainerCollectionResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(FileStorageContainer.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Models/FileStorageContainerCustomPropertyDictionary.cs b/src/generated/Models/FileStorageContainerCustomPropertyDictionary.cs new file mode 100644 index 0000000000..416a20e102 --- /dev/null +++ b/src/generated/Models/FileStorageContainerCustomPropertyDictionary.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class FileStorageContainerCustomPropertyDictionary : Dictionary, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new FileStorageContainerCustomPropertyDictionary CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FileStorageContainerCustomPropertyDictionary(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + } + } +} diff --git a/src/generated/Models/FileStorageContainerStatus.cs b/src/generated/Models/FileStorageContainerStatus.cs new file mode 100644 index 0000000000..148cec6aaf --- /dev/null +++ b/src/generated/Models/FileStorageContainerStatus.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public enum FileStorageContainerStatus + #pragma warning restore CS1591 + { + [EnumMember(Value = "inactive")] + #pragma warning disable CS1591 + Inactive, + #pragma warning restore CS1591 + [EnumMember(Value = "active")] + #pragma warning disable CS1591 + Active, + #pragma warning restore CS1591 + [EnumMember(Value = "unknownFutureValue")] + #pragma warning disable CS1591 + UnknownFutureValue, + #pragma warning restore CS1591 + } +} diff --git a/src/generated/Models/FileStorageContainerViewpoint.cs b/src/generated/Models/FileStorageContainerViewpoint.cs new file mode 100644 index 0000000000..e914d39de2 --- /dev/null +++ b/src/generated/Models/FileStorageContainerViewpoint.cs @@ -0,0 +1,72 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class FileStorageContainerViewpoint : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The current user's effective role. Read-only. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EffectiveRole { get; set; } +#nullable restore +#else + public string EffectiveRole { get; set; } +#endif + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FileStorageContainerViewpoint() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FileStorageContainerViewpoint CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FileStorageContainerViewpoint(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "effectiveRole", n => { EffectiveRole = n.GetStringValue(); } }, + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("effectiveRole", EffectiveRole); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/IdentityContainer.cs b/src/generated/Models/IdentityContainer.cs index 406b159825..ec8f0d77f7 100644 --- a/src/generated/Models/IdentityContainer.cs +++ b/src/generated/Models/IdentityContainer.cs @@ -25,6 +25,14 @@ public class IdentityContainer : Entity, IParsable #nullable restore #else public List AuthenticationEventListeners { get; set; } +#endif + /// Represents the entry point for self-service sign-up and sign-in user flows in both Microsoft Entra workforce and external tenants. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AuthenticationEventsFlows { get; set; } +#nullable restore +#else + public List AuthenticationEventsFlows { get; set; } #endif /// Represents entry point for B2X/self-service sign-up identity userflows. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -86,6 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "apiConnectors", n => { ApiConnectors = n.GetCollectionOfObjectValues(IdentityApiConnector.CreateFromDiscriminatorValue)?.ToList(); } }, { "authenticationEventListeners", n => { AuthenticationEventListeners = n.GetCollectionOfObjectValues(AuthenticationEventListener.CreateFromDiscriminatorValue)?.ToList(); } }, + { "authenticationEventsFlows", n => { AuthenticationEventsFlows = n.GetCollectionOfObjectValues(AuthenticationEventsFlow.CreateFromDiscriminatorValue)?.ToList(); } }, { "b2xUserFlows", n => { B2xUserFlows = n.GetCollectionOfObjectValues(B2xIdentityUserFlow.CreateFromDiscriminatorValue)?.ToList(); } }, { "conditionalAccess", n => { ConditionalAccess = n.GetObjectValue(ConditionalAccessRoot.CreateFromDiscriminatorValue); } }, { "customAuthenticationExtensions", n => { CustomAuthenticationExtensions = n.GetCollectionOfObjectValues(CustomAuthenticationExtension.CreateFromDiscriminatorValue)?.ToList(); } }, @@ -103,6 +112,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteCollectionOfObjectValues("apiConnectors", ApiConnectors); writer.WriteCollectionOfObjectValues("authenticationEventListeners", AuthenticationEventListeners); + writer.WriteCollectionOfObjectValues("authenticationEventsFlows", AuthenticationEventsFlows); writer.WriteCollectionOfObjectValues("b2xUserFlows", B2xUserFlows); writer.WriteObjectValue("conditionalAccess", ConditionalAccess); writer.WriteCollectionOfObjectValues("customAuthenticationExtensions", CustomAuthenticationExtensions); diff --git a/src/generated/Models/IdentityUserFlowAttribute.cs b/src/generated/Models/IdentityUserFlowAttribute.cs index 57f818db51..c8fb8eee22 100644 --- a/src/generated/Models/IdentityUserFlowAttribute.cs +++ b/src/generated/Models/IdentityUserFlowAttribute.cs @@ -12,7 +12,7 @@ public class IdentityUserFlowAttribute : Entity, IParsable { /// The dataType property public IdentityUserFlowAttributeDataType? DataType { get; set; } - /// The description of the user flow attribute that's shown to the user at the time of sign-up. + /// The description of the user flow attribute that's shown to the user at the time of sign up. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public string? Description { get; set; } diff --git a/src/generated/Models/OnAttributeCollectionExternalUsersSelfServiceSignUp.cs b/src/generated/Models/OnAttributeCollectionExternalUsersSelfServiceSignUp.cs new file mode 100644 index 0000000000..692e5e9911 --- /dev/null +++ b/src/generated/Models/OnAttributeCollectionExternalUsersSelfServiceSignUp.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnAttributeCollectionExternalUsersSelfServiceSignUp : OnAttributeCollectionHandler, IParsable + #pragma warning restore CS1591 + { + /// Required. The configuration for how attributes are displayed in the sign up experience defined by a user flow, like the externalUsersSelfServiceSignupEventsFlow, specifically on the attribute collection page. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public AuthenticationAttributeCollectionPage? AttributeCollectionPage { get; set; } +#nullable restore +#else + public AuthenticationAttributeCollectionPage AttributeCollectionPage { get; set; } +#endif + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Attributes { get; set; } +#nullable restore +#else + public List Attributes { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnAttributeCollectionExternalUsersSelfServiceSignUp() : base() + { + OdataType = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OnAttributeCollectionExternalUsersSelfServiceSignUp CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OnAttributeCollectionExternalUsersSelfServiceSignUp(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "attributeCollectionPage", n => { AttributeCollectionPage = n.GetObjectValue(AuthenticationAttributeCollectionPage.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetCollectionOfObjectValues(IdentityUserFlowAttribute.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("attributeCollectionPage", AttributeCollectionPage); + writer.WriteCollectionOfObjectValues("attributes", Attributes); + } + } +} diff --git a/src/generated/Models/OnAttributeCollectionHandler.cs b/src/generated/Models/OnAttributeCollectionHandler.cs new file mode 100644 index 0000000000..fb8d47ad5f --- /dev/null +++ b/src/generated/Models/OnAttributeCollectionHandler.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnAttributeCollectionHandler : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnAttributeCollectionHandler() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OnAttributeCollectionHandler CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("@odata.type")?.GetStringValue(); + return mappingValue switch + { + "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp" => new OnAttributeCollectionExternalUsersSelfServiceSignUp(), + _ => new OnAttributeCollectionHandler(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/OnAttributeCollectionListener.cs b/src/generated/Models/OnAttributeCollectionListener.cs new file mode 100644 index 0000000000..2716a05bc6 --- /dev/null +++ b/src/generated/Models/OnAttributeCollectionListener.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnAttributeCollectionListener : AuthenticationEventListener, IParsable + #pragma warning restore CS1591 + { + /// Required. Configuration for what to invoke if the event resolves to this listener. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OnAttributeCollectionHandler? Handler { get; set; } +#nullable restore +#else + public OnAttributeCollectionHandler Handler { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnAttributeCollectionListener() : base() + { + OdataType = "#microsoft.graph.onAttributeCollectionListener"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OnAttributeCollectionListener CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OnAttributeCollectionListener(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "handler", n => { Handler = n.GetObjectValue(OnAttributeCollectionHandler.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("handler", Handler); + } + } +} diff --git a/src/generated/Models/OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.cs b/src/generated/Models/OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.cs new file mode 100644 index 0000000000..ca54b64658 --- /dev/null +++ b/src/generated/Models/OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp : OnAuthenticationMethodLoadStartHandler, IParsable + #pragma warning restore CS1591 + { + /// The identityProviders property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? IdentityProviders { get; set; } +#nullable restore +#else + public List IdentityProviders { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp() : base() + { + OdataType = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "identityProviders", n => { IdentityProviders = n.GetCollectionOfObjectValues(IdentityProviderBase.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("identityProviders", IdentityProviders); + } + } +} diff --git a/src/generated/Models/OnAuthenticationMethodLoadStartHandler.cs b/src/generated/Models/OnAuthenticationMethodLoadStartHandler.cs new file mode 100644 index 0000000000..9de45e2b6c --- /dev/null +++ b/src/generated/Models/OnAuthenticationMethodLoadStartHandler.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnAuthenticationMethodLoadStartHandler : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnAuthenticationMethodLoadStartHandler() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OnAuthenticationMethodLoadStartHandler CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("@odata.type")?.GetStringValue(); + return mappingValue switch + { + "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp" => new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp(), + _ => new OnAuthenticationMethodLoadStartHandler(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/OnAuthenticationMethodLoadStartListener.cs b/src/generated/Models/OnAuthenticationMethodLoadStartListener.cs new file mode 100644 index 0000000000..53373ed53e --- /dev/null +++ b/src/generated/Models/OnAuthenticationMethodLoadStartListener.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnAuthenticationMethodLoadStartListener : AuthenticationEventListener, IParsable + #pragma warning restore CS1591 + { + /// Required. Configuration for what to invoke if the event resolves to this listener. This lets us define potential handler configurations per-event. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OnAuthenticationMethodLoadStartHandler? Handler { get; set; } +#nullable restore +#else + public OnAuthenticationMethodLoadStartHandler Handler { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnAuthenticationMethodLoadStartListener() : base() + { + OdataType = "#microsoft.graph.onAuthenticationMethodLoadStartListener"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OnAuthenticationMethodLoadStartListener CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OnAuthenticationMethodLoadStartListener(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "handler", n => { Handler = n.GetObjectValue(OnAuthenticationMethodLoadStartHandler.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("handler", Handler); + } + } +} diff --git a/src/generated/Models/OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp.cs b/src/generated/Models/OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp.cs new file mode 100644 index 0000000000..d91ded5074 --- /dev/null +++ b/src/generated/Models/OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp.cs @@ -0,0 +1,54 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp : OnInteractiveAuthFlowStartHandler, IParsable + #pragma warning restore CS1591 + { + /// Optional. Specifies whether the authentication flow includes an option to sign up (create account) and sign in. Default value is false meaning only sign in is enabled. + public bool? IsSignUpAllowed { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp() : base() + { + OdataType = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "isSignUpAllowed", n => { IsSignUpAllowed = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteBoolValue("isSignUpAllowed", IsSignUpAllowed); + } + } +} diff --git a/src/generated/Models/OnInteractiveAuthFlowStartHandler.cs b/src/generated/Models/OnInteractiveAuthFlowStartHandler.cs new file mode 100644 index 0000000000..1d38e59a3c --- /dev/null +++ b/src/generated/Models/OnInteractiveAuthFlowStartHandler.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnInteractiveAuthFlowStartHandler : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnInteractiveAuthFlowStartHandler() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OnInteractiveAuthFlowStartHandler CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("@odata.type")?.GetStringValue(); + return mappingValue switch + { + "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp" => new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp(), + _ => new OnInteractiveAuthFlowStartHandler(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/OnInteractiveAuthFlowStartListener.cs b/src/generated/Models/OnInteractiveAuthFlowStartListener.cs new file mode 100644 index 0000000000..57e59cdbdc --- /dev/null +++ b/src/generated/Models/OnInteractiveAuthFlowStartListener.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnInteractiveAuthFlowStartListener : AuthenticationEventListener, IParsable + #pragma warning restore CS1591 + { + /// Required. Configuration for what to invoke if the event resolves to this listener. This lets us define potential handler configurations per-event. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OnInteractiveAuthFlowStartHandler? Handler { get; set; } +#nullable restore +#else + public OnInteractiveAuthFlowStartHandler Handler { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnInteractiveAuthFlowStartListener() : base() + { + OdataType = "#microsoft.graph.onInteractiveAuthFlowStartListener"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OnInteractiveAuthFlowStartListener CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OnInteractiveAuthFlowStartListener(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "handler", n => { Handler = n.GetObjectValue(OnInteractiveAuthFlowStartHandler.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("handler", Handler); + } + } +} diff --git a/src/generated/Models/OnUserCreateStartExternalUsersSelfServiceSignUp.cs b/src/generated/Models/OnUserCreateStartExternalUsersSelfServiceSignUp.cs new file mode 100644 index 0000000000..a52cc0f906 --- /dev/null +++ b/src/generated/Models/OnUserCreateStartExternalUsersSelfServiceSignUp.cs @@ -0,0 +1,54 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnUserCreateStartExternalUsersSelfServiceSignUp : OnUserCreateStartHandler, IParsable + #pragma warning restore CS1591 + { + /// The type of user to create. Maps to userType property of user object. The possible values are: member, guest, unknownFutureValue. + public UserType? UserTypeToCreate { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public OnUserCreateStartExternalUsersSelfServiceSignUp() : base() + { + OdataType = "#microsoft.graph.onUserCreateStartExternalUsersSelfServiceSignUp"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OnUserCreateStartExternalUsersSelfServiceSignUp CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OnUserCreateStartExternalUsersSelfServiceSignUp(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "userTypeToCreate", n => { UserTypeToCreate = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("userTypeToCreate", UserTypeToCreate); + } + } +} diff --git a/src/generated/Models/OnUserCreateStartHandler.cs b/src/generated/Models/OnUserCreateStartHandler.cs new file mode 100644 index 0000000000..21afd51d66 --- /dev/null +++ b/src/generated/Models/OnUserCreateStartHandler.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnUserCreateStartHandler : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnUserCreateStartHandler() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OnUserCreateStartHandler CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("@odata.type")?.GetStringValue(); + return mappingValue switch + { + "#microsoft.graph.onUserCreateStartExternalUsersSelfServiceSignUp" => new OnUserCreateStartExternalUsersSelfServiceSignUp(), + _ => new OnUserCreateStartHandler(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/OnUserCreateStartListener.cs b/src/generated/Models/OnUserCreateStartListener.cs new file mode 100644 index 0000000000..11b53afa9d --- /dev/null +++ b/src/generated/Models/OnUserCreateStartListener.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class OnUserCreateStartListener : AuthenticationEventListener, IParsable + #pragma warning restore CS1591 + { + /// Required. Configuration for what to invoke if the event resolves to this listener. This lets us define potential handler configurations per-event. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OnUserCreateStartHandler? Handler { get; set; } +#nullable restore +#else + public OnUserCreateStartHandler Handler { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OnUserCreateStartListener() : base() + { + OdataType = "#microsoft.graph.onUserCreateStartListener"; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OnUserCreateStartListener CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OnUserCreateStartListener(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "handler", n => { Handler = n.GetObjectValue(OnUserCreateStartHandler.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("handler", Handler); + } + } +} diff --git a/src/generated/Models/OrganizationalBrandingProperties.cs b/src/generated/Models/OrganizationalBrandingProperties.cs index 462a5989a7..10fc11aaeb 100644 --- a/src/generated/Models/OrganizationalBrandingProperties.cs +++ b/src/generated/Models/OrganizationalBrandingProperties.cs @@ -18,7 +18,7 @@ public class OrganizationalBrandingProperties : Entity, IParsable #else public string BackgroundColor { get; set; } #endif - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public byte[]? BackgroundImage { get; set; } @@ -58,7 +58,7 @@ public class OrganizationalBrandingProperties : Entity, IParsable #else public List CdnList { get; set; } #endif - /// The contentCustomization property + /// Represents the content options to be customized throughout the authentication flow for a tenant. NOTE: Supported by Microsoft Entra External ID in external tenants only. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public ApiSdk.Models.ContentCustomization? ContentCustomization { get; set; } diff --git a/src/generated/Models/SignInActivity.cs b/src/generated/Models/SignInActivity.cs index 3e1f4398e6..a8feb74eb9 100644 --- a/src/generated/Models/SignInActivity.cs +++ b/src/generated/Models/SignInActivity.cs @@ -12,7 +12,7 @@ public class SignInActivity : IAdditionalDataHolder, IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// The last non-interactive sign-in date for a specific user. You can use this field to calculate the last time a client attempted (either successfully or unsuccessfully) to sign in to the directory on behalf of a user. Because some users may use clients to access tenant resources rather than signing into your tenant directly, you can use the non-interactive sign-in date to along with lastSignInDateTime to identify inactive users. The timestamp represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is: '2014-01-01T00:00:00Z'. Microsoft Entra ID maintains non-interactive sign-ins going back to May 2020. For more information about using the value of this property, see Manage inactive user accounts in Microsoft Entra ID. + /// The last non-interactive sign-in date for a specific user. You can use this field to calculate the last time a client attempted (either successfully or unsuccessfully) to sign in to the directory on behalf of a user. Because some users may use clients to access tenant resources rather than signing into your tenant directly, you can use the non-interactive sign-in date to along with lastSignInDateTime to identify inactive users. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Microsoft Entra ID maintains non-interactive sign-ins going back to May 2020. For more information about using the value of this property, see Manage inactive user accounts in Microsoft Entra ID. public DateTimeOffset? LastNonInteractiveSignInDateTime { get; set; } /// Request identifier of the last non-interactive sign-in performed by this user. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -22,7 +22,7 @@ public class SignInActivity : IAdditionalDataHolder, IParsable #else public string LastNonInteractiveSignInRequestId { get; set; } #endif - /// The last interactive sign-in date and time for a specific user. You can use this field to calculate the last time a user attempted (either successfully or unsuccessfully) to sign in to the directory with an interactive authentication method. This field can be used to build reports, such as inactive users. The timestamp represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is: '2014-01-01T00:00:00Z'. Microsoft Entra ID maintains interactive sign-ins going back to April 2020. For more information about using the value of this property, see Manage inactive user accounts in Microsoft Entra ID. + /// The last interactive sign-in date and time for a specific user. You can use this field to calculate the last time a user attempted (either successfully or unsuccessfully) to sign in to the directory with an interactive authentication method. This field can be used to build reports, such as inactive users. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Microsoft Entra ID maintains interactive sign-ins going back to April 2020. For more information about using the value of this property, see Manage inactive user accounts in Microsoft Entra ID. public DateTimeOffset? LastSignInDateTime { get; set; } /// Request identifier of the last interactive sign-in performed by this user. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -31,6 +31,16 @@ public class SignInActivity : IAdditionalDataHolder, IParsable #nullable restore #else public string LastSignInRequestId { get; set; } +#endif + /// The date and time of the user's most recent successful sign-in activity. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. + public DateTimeOffset? LastSuccessfulSignInDateTime { get; set; } + /// The request ID of the last successful sign-in. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastSuccessfulSignInRequestId { get; set; } +#nullable restore +#else + public string LastSuccessfulSignInRequestId { get; set; } #endif /// The OdataType property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -69,6 +79,8 @@ public virtual IDictionary> GetFieldDeserializers() { "lastNonInteractiveSignInRequestId", n => { LastNonInteractiveSignInRequestId = n.GetStringValue(); } }, { "lastSignInDateTime", n => { LastSignInDateTime = n.GetDateTimeOffsetValue(); } }, { "lastSignInRequestId", n => { LastSignInRequestId = n.GetStringValue(); } }, + { "lastSuccessfulSignInDateTime", n => { LastSuccessfulSignInDateTime = n.GetDateTimeOffsetValue(); } }, + { "lastSuccessfulSignInRequestId", n => { LastSuccessfulSignInRequestId = n.GetStringValue(); } }, { "@odata.type", n => { OdataType = n.GetStringValue(); } }, }; } @@ -83,6 +95,8 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("lastNonInteractiveSignInRequestId", LastNonInteractiveSignInRequestId); writer.WriteDateTimeOffsetValue("lastSignInDateTime", LastSignInDateTime); writer.WriteStringValue("lastSignInRequestId", LastSignInRequestId); + writer.WriteDateTimeOffsetValue("lastSuccessfulSignInDateTime", LastSuccessfulSignInDateTime); + writer.WriteStringValue("lastSuccessfulSignInRequestId", LastSuccessfulSignInRequestId); writer.WriteStringValue("@odata.type", OdataType); writer.WriteAdditionalData(AdditionalData); } diff --git a/src/generated/Models/SiteArchivalDetails.cs b/src/generated/Models/SiteArchivalDetails.cs new file mode 100644 index 0000000000..5170087090 --- /dev/null +++ b/src/generated/Models/SiteArchivalDetails.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class SiteArchivalDetails : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The archiveStatus property + public SiteArchiveStatus? ArchiveStatus { get; set; } + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SiteArchivalDetails() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SiteArchivalDetails CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SiteArchivalDetails(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "archiveStatus", n => { ArchiveStatus = n.GetEnumValue(); } }, + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("archiveStatus", ArchiveStatus); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/SiteArchiveStatus.cs b/src/generated/Models/SiteArchiveStatus.cs new file mode 100644 index 0000000000..05aa53c385 --- /dev/null +++ b/src/generated/Models/SiteArchiveStatus.cs @@ -0,0 +1,27 @@ +// +using System.Runtime.Serialization; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public enum SiteArchiveStatus + #pragma warning restore CS1591 + { + [EnumMember(Value = "recentlyArchived")] + #pragma warning disable CS1591 + RecentlyArchived, + #pragma warning restore CS1591 + [EnumMember(Value = "fullyArchived")] + #pragma warning disable CS1591 + FullyArchived, + #pragma warning restore CS1591 + [EnumMember(Value = "reactivating")] + #pragma warning disable CS1591 + Reactivating, + #pragma warning restore CS1591 + [EnumMember(Value = "unknownFutureValue")] + #pragma warning disable CS1591 + UnknownFutureValue, + #pragma warning restore CS1591 + } +} diff --git a/src/generated/Models/SiteCollection.cs b/src/generated/Models/SiteCollection.cs index bb7ce97e59..185f293a47 100644 --- a/src/generated/Models/SiteCollection.cs +++ b/src/generated/Models/SiteCollection.cs @@ -12,6 +12,14 @@ public class SiteCollection : IAdditionalDataHolder, IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } + /// The archivalDetails property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public SiteArchivalDetails? ArchivalDetails { get; set; } +#nullable restore +#else + public SiteArchivalDetails ArchivalDetails { get; set; } +#endif /// The geographic region code for where this site collection resides. Only present for multi-geo tenants. Read-only. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -69,6 +77,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { + { "archivalDetails", n => { ArchivalDetails = n.GetObjectValue(SiteArchivalDetails.CreateFromDiscriminatorValue); } }, { "dataLocationCode", n => { DataLocationCode = n.GetStringValue(); } }, { "hostname", n => { Hostname = n.GetStringValue(); } }, { "@odata.type", n => { OdataType = n.GetStringValue(); } }, @@ -82,6 +91,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("archivalDetails", ArchivalDetails); writer.WriteStringValue("dataLocationCode", DataLocationCode); writer.WriteStringValue("hostname", Hostname); writer.WriteStringValue("@odata.type", OdataType); diff --git a/src/generated/Models/Storage.cs b/src/generated/Models/Storage.cs new file mode 100644 index 0000000000..c30b2f08c1 --- /dev/null +++ b/src/generated/Models/Storage.cs @@ -0,0 +1,72 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public class Storage : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fileStorage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ApiSdk.Models.FileStorage? FileStorage { get; set; } +#nullable restore +#else + public ApiSdk.Models.FileStorage FileStorage { get; set; } +#endif + /// The OdataType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OdataType { get; set; } +#nullable restore +#else + public string OdataType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Storage() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Storage CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Storage(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fileStorage", n => { FileStorage = n.GetObjectValue(ApiSdk.Models.FileStorage.CreateFromDiscriminatorValue); } }, + { "@odata.type", n => { OdataType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fileStorage", FileStorage); + writer.WriteStringValue("@odata.type", OdataType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Models/UserType.cs b/src/generated/Models/UserType.cs new file mode 100644 index 0000000000..7b1acaf81f --- /dev/null +++ b/src/generated/Models/UserType.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace ApiSdk.Models +{ + #pragma warning disable CS1591 + public enum UserType + #pragma warning restore CS1591 + { + [EnumMember(Value = "member")] + #pragma warning disable CS1591 + Member, + #pragma warning restore CS1591 + [EnumMember(Value = "guest")] + #pragma warning disable CS1591 + Guest, + #pragma warning restore CS1591 + [EnumMember(Value = "unknownFutureValue")] + #pragma warning disable CS1591 + UnknownFutureValue, + #pragma warning restore CS1591 + } +} diff --git a/src/generated/Organization/Item/Branding/BackgroundImage/BackgroundImageRequestBuilder.cs b/src/generated/Organization/Item/Branding/BackgroundImage/BackgroundImageRequestBuilder.cs index b83aacaaf7..f7d11a2ba0 100644 --- a/src/generated/Organization/Item/Branding/BackgroundImage/BackgroundImageRequestBuilder.cs +++ b/src/generated/Organization/Item/Branding/BackgroundImage/BackgroundImageRequestBuilder.cs @@ -21,13 +21,13 @@ namespace ApiSdk.Organization.Item.Branding.BackgroundImage public class BackgroundImageRequestBuilder : BaseCliRequestBuilder { /// - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster."; + command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster."; var organizationIdOption = new Option("--organization-id", description: "The unique identifier of organization") { }; organizationIdOption.IsRequired = true; @@ -56,13 +56,13 @@ public Command BuildDeleteCommand() return command; } /// - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster."; + command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster."; var organizationIdOption = new Option("--organization-id", description: "The unique identifier of organization") { }; organizationIdOption.IsRequired = true; @@ -96,13 +96,13 @@ public Command BuildGetCommand() return command; } /// - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster."; + command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster."; var organizationIdOption = new Option("--organization-id", description: "The unique identifier of organization") { }; organizationIdOption.IsRequired = true; @@ -165,7 +165,7 @@ public BackgroundImageRequestBuilder(string rawUrl) : base("{+baseurl}/organizat { } /// - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -184,7 +184,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -203,7 +203,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A /// Binary request body diff --git a/src/generated/Organization/Item/Branding/Localizations/Item/BackgroundImage/BackgroundImageRequestBuilder.cs b/src/generated/Organization/Item/Branding/Localizations/Item/BackgroundImage/BackgroundImageRequestBuilder.cs index 0b68ee62c8..665cce5867 100644 --- a/src/generated/Organization/Item/Branding/Localizations/Item/BackgroundImage/BackgroundImageRequestBuilder.cs +++ b/src/generated/Organization/Item/Branding/Localizations/Item/BackgroundImage/BackgroundImageRequestBuilder.cs @@ -21,13 +21,13 @@ namespace ApiSdk.Organization.Item.Branding.Localizations.Item.BackgroundImage public class BackgroundImageRequestBuilder : BaseCliRequestBuilder { /// - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster."; + command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster."; var organizationIdOption = new Option("--organization-id", description: "The unique identifier of organization") { }; organizationIdOption.IsRequired = true; @@ -62,13 +62,13 @@ public Command BuildDeleteCommand() return command; } /// - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster."; + command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster."; var organizationIdOption = new Option("--organization-id", description: "The unique identifier of organization") { }; organizationIdOption.IsRequired = true; @@ -108,13 +108,13 @@ public Command BuildGetCommand() return command; } /// - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster."; + command.Description = "Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster."; var organizationIdOption = new Option("--organization-id", description: "The unique identifier of organization") { }; organizationIdOption.IsRequired = true; @@ -183,7 +183,7 @@ public BackgroundImageRequestBuilder(string rawUrl) : base("{+baseurl}/organizat { } /// - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -202,7 +202,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -221,7 +221,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image will reduce bandwidth requirements and make the page load faster. + /// Image that appears as the background of the sign-in page. The allowed types are PNG or JPEG not smaller than 300 KB and not larger than 1920 × 1080 pixels. A smaller image reduces bandwidth requirements and make the page load faster. /// /// A /// Binary request body diff --git a/src/generated/Organization/Item/Branding/Localizations/Item/BannerLogo/BannerLogoRequestBuilder.cs b/src/generated/Organization/Item/Branding/Localizations/Item/BannerLogo/BannerLogoRequestBuilder.cs index 6b4617b62e..65db20d748 100644 --- a/src/generated/Organization/Item/Branding/Localizations/Item/BannerLogo/BannerLogoRequestBuilder.cs +++ b/src/generated/Organization/Item/Branding/Localizations/Item/BannerLogo/BannerLogoRequestBuilder.cs @@ -62,14 +62,14 @@ public Command BuildDeleteCommand() return command; } /// - /// Retrieve the default organizational branding object, if the Accept-Language header is set to 0 or default. If no default organizational branding object exists, this method returns a 404 Not Found error. If the Accept-Language header is set to an existing locale identified by the value of its id, this method retrieves the branding for the specified locale. This method retrieves only non-Stream properties, for example, usernameHintText and signInPageText. To retrieve Stream types of the default branding, for example, bannerLogo and backgroundImage, use the GET organizationalBrandingLocalization method. - /// Find more info here + /// Read the properties and relationships of an organizationalBrandingLocalization object. To retrieve a localization branding object, specify the value of id in the URL. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Retrieve the default organizational branding object, if the Accept-Language header is set to 0 or default. If no default organizational branding object exists, this method returns a 404 Not Found error. If the Accept-Language header is set to an existing locale identified by the value of its id, this method retrieves the branding for the specified locale. This method retrieves only non-Stream properties, for example, usernameHintText and signInPageText. To retrieve Stream types of the default branding, for example, bannerLogo and backgroundImage, use the GET organizationalBrandingLocalization method.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/organizationalbranding-get?view=graph-rest-1.0"; + command.Description = "Read the properties and relationships of an organizationalBrandingLocalization object. To retrieve a localization branding object, specify the value of id in the URL.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/organizationalbrandinglocalization-get?view=graph-rest-1.0"; var organizationIdOption = new Option("--organization-id", description: "The unique identifier of organization") { }; organizationIdOption.IsRequired = true; @@ -204,7 +204,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Retrieve the default organizational branding object, if the Accept-Language header is set to 0 or default. If no default organizational branding object exists, this method returns a 404 Not Found error. If the Accept-Language header is set to an existing locale identified by the value of its id, this method retrieves the branding for the specified locale. This method retrieves only non-Stream properties, for example, usernameHintText and signInPageText. To retrieve Stream types of the default branding, for example, bannerLogo and backgroundImage, use the GET organizationalBrandingLocalization method. + /// Read the properties and relationships of an organizationalBrandingLocalization object. To retrieve a localization branding object, specify the value of id in the URL. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. diff --git a/src/generated/Organization/Item/OrganizationItemRequestBuilder.cs b/src/generated/Organization/Item/OrganizationItemRequestBuilder.cs index e5d1f7a143..da09c9d113 100644 --- a/src/generated/Organization/Item/OrganizationItemRequestBuilder.cs +++ b/src/generated/Organization/Item/OrganizationItemRequestBuilder.cs @@ -186,14 +186,14 @@ public Command BuildExtensionsNavCommand() return command; } /// - /// Read properties and relationships of the organization object. - /// Find more info here + /// Get the properties and relationships of the currently authenticated organization. Since the organization resource supports extensions, you can also use the GET operation to get custom properties and extension data in an organization instance. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Read properties and relationships of the organization object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-organization-get?view=graph-rest-1.0"; + command.Description = "Get the properties and relationships of the currently authenticated organization. Since the organization resource supports extensions, you can also use the GET operation to get custom properties and extension data in an organization instance.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/organization-get?view=graph-rest-1.0"; var organizationIdOption = new Option("--organization-id", description: "The unique identifier of organization") { }; organizationIdOption.IsRequired = true; @@ -392,7 +392,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Read properties and relationships of the organization object. + /// Get the properties and relationships of the currently authenticated organization. Since the organization resource supports extensions, you can also use the GET operation to get custom properties and extension data in an organization instance. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -432,7 +432,7 @@ public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Organization b return requestInfo; } /// - /// Read properties and relationships of the organization object. + /// Get the properties and relationships of the currently authenticated organization. Since the organization resource supports extensions, you can also use the GET operation to get custom properties and extension data in an organization instance. /// public class OrganizationItemRequestBuilderGetQueryParameters { diff --git a/src/generated/Policies/CrossTenantAccessPolicy/Partners/Item/IdentitySynchronization/IdentitySynchronizationRequestBuilder.cs b/src/generated/Policies/CrossTenantAccessPolicy/Partners/Item/IdentitySynchronization/IdentitySynchronizationRequestBuilder.cs index faa4027d27..d3625b43e1 100644 --- a/src/generated/Policies/CrossTenantAccessPolicy/Partners/Item/IdentitySynchronization/IdentitySynchronizationRequestBuilder.cs +++ b/src/generated/Policies/CrossTenantAccessPolicy/Partners/Item/IdentitySynchronization/IdentitySynchronizationRequestBuilder.cs @@ -111,14 +111,14 @@ public Command BuildGetCommand() return command; } /// - /// Update the user synchronization policy of a partner-specific configuration. - /// Find more info here + /// Create a cross-tenant user synchronization policy for a partner-specific configuration. + /// Find more info here /// /// A public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Update the user synchronization policy of a partner-specific configuration.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/crosstenantidentitysyncpolicypartner-update?view=graph-rest-1.0"; + command.Description = "Create a cross-tenant user synchronization policy for a partner-specific configuration.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/crosstenantaccesspolicyconfigurationpartner-put-identitysynchronization?view=graph-rest-1.0"; var crossTenantAccessPolicyConfigurationPartnerTenantIdOption = new Option("--cross-tenant-access-policy-configuration-partner-tenant-id", description: "The unique identifier of crossTenantAccessPolicyConfigurationPartner") { }; crossTenantAccessPolicyConfigurationPartnerTenantIdOption.IsRequired = true; @@ -215,7 +215,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Update the user synchronization policy of a partner-specific configuration. + /// Create a cross-tenant user synchronization policy for a partner-specific configuration. /// /// A /// The request body diff --git a/src/generated/Reports/AuthenticationMethods/UsersRegisteredByFeatureWithIncludedUserTypesWithIncludedUserRoles/UsersRegisteredByFeatureWithIncludedUserTypesWithIncludedUserRolesRequestBuilder.cs b/src/generated/Reports/AuthenticationMethods/UsersRegisteredByFeatureWithIncludedUserTypesWithIncludedUserRoles/UsersRegisteredByFeatureWithIncludedUserTypesWithIncludedUserRolesRequestBuilder.cs index 8e46b6d1b3..ba5866c2cb 100644 --- a/src/generated/Reports/AuthenticationMethods/UsersRegisteredByFeatureWithIncludedUserTypesWithIncludedUserRoles/UsersRegisteredByFeatureWithIncludedUserTypesWithIncludedUserRolesRequestBuilder.cs +++ b/src/generated/Reports/AuthenticationMethods/UsersRegisteredByFeatureWithIncludedUserTypesWithIncludedUserRoles/UsersRegisteredByFeatureWithIncludedUserTypesWithIncludedUserRolesRequestBuilder.cs @@ -29,11 +29,11 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usersRegisteredByFeature"; - var includedUserTypesOption = new Option("--included-user-types", description: "Usage: includedUserTypes='{includedUserTypes}'") { + var includedUserTypesOption = new Option("--included-user-types", description: "Usage: includedUserTypes='{includedUserTypes}'") { }; includedUserTypesOption.IsRequired = true; command.AddOption(includedUserTypesOption); - var includedUserRolesOption = new Option("--included-user-roles", description: "Usage: includedUserRoles='{includedUserRoles}'") { + var includedUserRolesOption = new Option("--included-user-roles", description: "Usage: includedUserRoles='{includedUserRoles}'") { }; includedUserRolesOption.IsRequired = true; command.AddOption(includedUserRolesOption); diff --git a/src/generated/Reports/AuthenticationMethods/UsersRegisteredByMethodWithIncludedUserTypesWithIncludedUserRoles/UsersRegisteredByMethodWithIncludedUserTypesWithIncludedUserRolesRequestBuilder.cs b/src/generated/Reports/AuthenticationMethods/UsersRegisteredByMethodWithIncludedUserTypesWithIncludedUserRoles/UsersRegisteredByMethodWithIncludedUserTypesWithIncludedUserRolesRequestBuilder.cs index 3dd8341642..5b3ff12ed8 100644 --- a/src/generated/Reports/AuthenticationMethods/UsersRegisteredByMethodWithIncludedUserTypesWithIncludedUserRoles/UsersRegisteredByMethodWithIncludedUserTypesWithIncludedUserRolesRequestBuilder.cs +++ b/src/generated/Reports/AuthenticationMethods/UsersRegisteredByMethodWithIncludedUserTypesWithIncludedUserRoles/UsersRegisteredByMethodWithIncludedUserTypesWithIncludedUserRolesRequestBuilder.cs @@ -29,11 +29,11 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Invoke function usersRegisteredByMethod"; - var includedUserTypesOption = new Option("--included-user-types", description: "Usage: includedUserTypes='{includedUserTypes}'") { + var includedUserTypesOption = new Option("--included-user-types", description: "Usage: includedUserTypes='{includedUserTypes}'") { }; includedUserTypesOption.IsRequired = true; command.AddOption(includedUserTypesOption); - var includedUserRolesOption = new Option("--included-user-roles", description: "Usage: includedUserRoles='{includedUserRoles}'") { + var includedUserRolesOption = new Option("--included-user-roles", description: "Usage: includedUserRoles='{includedUserRoles}'") { }; includedUserRolesOption.IsRequired = true; command.AddOption(includedUserRolesOption); diff --git a/src/generated/Reports/GetEmailActivityUserDetailWithDate/GetEmailActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetEmailActivityUserDetailWithDate/GetEmailActivityUserDetailWithDateRequestBuilder.cs index 17ed6a74f7..5c32ec0da3 100644 --- a/src/generated/Reports/GetEmailActivityUserDetailWithDate/GetEmailActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetEmailActivityUserDetailWithDate/GetEmailActivityUserDetailWithDateRequestBuilder.cs @@ -28,7 +28,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about email activity users have performed."; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetEmailAppUsageUserDetailWithDate/GetEmailAppUsageUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetEmailAppUsageUserDetailWithDate/GetEmailAppUsageUserDetailWithDateRequestBuilder.cs index 3e70d92c43..bd5f8e3a81 100644 --- a/src/generated/Reports/GetEmailAppUsageUserDetailWithDate/GetEmailAppUsageUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetEmailAppUsageUserDetailWithDate/GetEmailAppUsageUserDetailWithDateRequestBuilder.cs @@ -28,7 +28,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about which activities users performed on the various email apps."; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTime/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/Reports/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTime/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs index 4134b10371..ac58271bef 100644 --- a/src/generated/Reports/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTime/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/Reports/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTime/GetGroupArchivedPrintJobsWithGroupIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -33,11 +33,11 @@ public Command BuildGetCommand() }; groupIdOption.IsRequired = true; command.AddOption(groupIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/Reports/GetM365AppUserDetailWithDate/GetM365AppUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetM365AppUserDetailWithDate/GetM365AppUserDetailWithDateRequestBuilder.cs index c35d948882..ab5c84969b 100644 --- a/src/generated/Reports/GetM365AppUserDetailWithDate/GetM365AppUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetM365AppUserDetailWithDate/GetM365AppUserDetailWithDateRequestBuilder.cs @@ -28,7 +28,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get a report that provides the details about which apps and platforms users have used."; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetOffice365ActiveUserDetailWithDate/GetOffice365ActiveUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetOffice365ActiveUserDetailWithDate/GetOffice365ActiveUserDetailWithDateRequestBuilder.cs index d706fd3c0f..90b88a152b 100644 --- a/src/generated/Reports/GetOffice365ActiveUserDetailWithDate/GetOffice365ActiveUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365ActiveUserDetailWithDate/GetOffice365ActiveUserDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Microsoft 365 active users.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getoffice365activeuserdetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetOffice365GroupsActivityDetailWithDate/GetOffice365GroupsActivityDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetOffice365GroupsActivityDetailWithDate/GetOffice365GroupsActivityDetailWithDateRequestBuilder.cs index ac9520117e..b422cab9b9 100644 --- a/src/generated/Reports/GetOffice365GroupsActivityDetailWithDate/GetOffice365GroupsActivityDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetOffice365GroupsActivityDetailWithDate/GetOffice365GroupsActivityDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Microsoft 365 groups activity by group.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getoffice365groupsactivitydetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetOneDriveActivityUserDetailWithDate/GetOneDriveActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetOneDriveActivityUserDetailWithDate/GetOneDriveActivityUserDetailWithDateRequestBuilder.cs index d168a02c6e..100ba42ca6 100644 --- a/src/generated/Reports/GetOneDriveActivityUserDetailWithDate/GetOneDriveActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveActivityUserDetailWithDate/GetOneDriveActivityUserDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about OneDrive activity by user.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getonedriveactivityuserdetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetOneDriveUsageAccountDetailWithDate/GetOneDriveUsageAccountDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetOneDriveUsageAccountDetailWithDate/GetOneDriveUsageAccountDetailWithDateRequestBuilder.cs index 2e3edd1ad1..ec50dd9596 100644 --- a/src/generated/Reports/GetOneDriveUsageAccountDetailWithDate/GetOneDriveUsageAccountDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetOneDriveUsageAccountDetailWithDate/GetOneDriveUsageAccountDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about OneDrive usage by account.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getonedriveusageaccountdetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTime/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/Reports/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTime/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs index d7a45ce5d8..d495c69a0d 100644 --- a/src/generated/Reports/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTime/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/Reports/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTime/GetPrinterArchivedPrintJobsWithPrinterIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -33,11 +33,11 @@ public Command BuildGetCommand() }; printerIdOption.IsRequired = true; command.AddOption(printerIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/Reports/GetSharePointActivityUserDetailWithDate/GetSharePointActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetSharePointActivityUserDetailWithDate/GetSharePointActivityUserDetailWithDateRequestBuilder.cs index 875d0d8c71..6ba440cf13 100644 --- a/src/generated/Reports/GetSharePointActivityUserDetailWithDate/GetSharePointActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointActivityUserDetailWithDate/GetSharePointActivityUserDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about SharePoint activity by user.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getsharepointactivityuserdetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetSharePointSiteUsageDetailWithDate/GetSharePointSiteUsageDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetSharePointSiteUsageDetailWithDate/GetSharePointSiteUsageDetailWithDateRequestBuilder.cs index 0022d20a92..b3ad8afb2b 100644 --- a/src/generated/Reports/GetSharePointSiteUsageDetailWithDate/GetSharePointSiteUsageDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetSharePointSiteUsageDetailWithDate/GetSharePointSiteUsageDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about SharePoint site usage.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getsharepointsiteusagedetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithDate/GetSkypeForBusinessActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithDate/GetSkypeForBusinessActivityUserDetailWithDateRequestBuilder.cs index 3c4382c43d..d5a4adcd08 100644 --- a/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithDate/GetSkypeForBusinessActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessActivityUserDetailWithDate/GetSkypeForBusinessActivityUserDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Skype for Business activity by user.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getskypeforbusinessactivityuserdetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithDate/GetSkypeForBusinessDeviceUsageUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithDate/GetSkypeForBusinessDeviceUsageUserDetailWithDateRequestBuilder.cs index ce985fcd84..7166994e53 100644 --- a/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithDate/GetSkypeForBusinessDeviceUsageUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetSkypeForBusinessDeviceUsageUserDetailWithDate/GetSkypeForBusinessDeviceUsageUserDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Skype for Business device usage by user.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getskypeforbusinessdeviceusageuserdetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithDate/GetTeamsDeviceUsageUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithDate/GetTeamsDeviceUsageUserDetailWithDateRequestBuilder.cs index 06f9919cb6..248528cda6 100644 --- a/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithDate/GetTeamsDeviceUsageUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsDeviceUsageUserDetailWithDate/GetTeamsDeviceUsageUserDetailWithDateRequestBuilder.cs @@ -28,7 +28,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Microsoft Teams device usage by user."; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetTeamsTeamActivityDetailWithDate/GetTeamsTeamActivityDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetTeamsTeamActivityDetailWithDate/GetTeamsTeamActivityDetailWithDateRequestBuilder.cs index 898a84b42c..58ab861837 100644 --- a/src/generated/Reports/GetTeamsTeamActivityDetailWithDate/GetTeamsTeamActivityDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsTeamActivityDetailWithDate/GetTeamsTeamActivityDetailWithDateRequestBuilder.cs @@ -28,7 +28,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Microsoft Teams activity by team. The numbers include activities for both licensed and nonlicensed users."; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetTeamsUserActivityUserDetailWithDate/GetTeamsUserActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetTeamsUserActivityUserDetailWithDate/GetTeamsUserActivityUserDetailWithDateRequestBuilder.cs index daed3eec5f..7a4efba668 100644 --- a/src/generated/Reports/GetTeamsUserActivityUserDetailWithDate/GetTeamsUserActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetTeamsUserActivityUserDetailWithDate/GetTeamsUserActivityUserDetailWithDateRequestBuilder.cs @@ -28,7 +28,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Microsoft Teams user activity by user."; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTime/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs b/src/generated/Reports/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTime/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs index bcc8100f9c..051979eb0b 100644 --- a/src/generated/Reports/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTime/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs +++ b/src/generated/Reports/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTime/GetUserArchivedPrintJobsWithUserIdWithStartDateTimeWithEndDateTimeRequestBuilder.cs @@ -33,11 +33,11 @@ public Command BuildGetCommand() }; userIdOption.IsRequired = true; command.AddOption(userIdOption); - var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime={startDateTime}") { }; startDateTimeOption.IsRequired = true; command.AddOption(startDateTimeOption); - var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime={endDateTime}") { }; endDateTimeOption.IsRequired = true; command.AddOption(endDateTimeOption); diff --git a/src/generated/Reports/GetYammerActivityUserDetailWithDate/GetYammerActivityUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetYammerActivityUserDetailWithDate/GetYammerActivityUserDetailWithDateRequestBuilder.cs index 9fd01e24f6..f610d337ba 100644 --- a/src/generated/Reports/GetYammerActivityUserDetailWithDate/GetYammerActivityUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetYammerActivityUserDetailWithDate/GetYammerActivityUserDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Yammer activity by user.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getyammeractivityuserdetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetYammerDeviceUsageUserDetailWithDate/GetYammerDeviceUsageUserDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetYammerDeviceUsageUserDetailWithDate/GetYammerDeviceUsageUserDetailWithDateRequestBuilder.cs index 6803a7ceb5..7ad00f8a54 100644 --- a/src/generated/Reports/GetYammerDeviceUsageUserDetailWithDate/GetYammerDeviceUsageUserDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetYammerDeviceUsageUserDetailWithDate/GetYammerDeviceUsageUserDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Yammer device usage by user.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getyammerdeviceusageuserdetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Reports/GetYammerGroupsActivityDetailWithDate/GetYammerGroupsActivityDetailWithDateRequestBuilder.cs b/src/generated/Reports/GetYammerGroupsActivityDetailWithDate/GetYammerGroupsActivityDetailWithDateRequestBuilder.cs index a714e045bf..27f72baf65 100644 --- a/src/generated/Reports/GetYammerGroupsActivityDetailWithDate/GetYammerGroupsActivityDetailWithDateRequestBuilder.cs +++ b/src/generated/Reports/GetYammerGroupsActivityDetailWithDate/GetYammerGroupsActivityDetailWithDateRequestBuilder.cs @@ -29,7 +29,7 @@ public Command BuildGetCommand() { var command = new Command("get"); command.Description = "Get details about Yammer groups activity by group.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/reportroot-getyammergroupsactivitydetail?view=graph-rest-1.0"; - var dateOption = new Option("--date", description: "Usage: date={date}") { + var dateOption = new Option("--date", description: "Usage: date={date}") { }; dateOption.IsRequired = true; command.AddOption(dateOption); diff --git a/src/generated/Security/MicrosoftGraphSecurityRunHuntingQuery/MicrosoftGraphSecurityRunHuntingQueryRequestBuilder.cs b/src/generated/Security/MicrosoftGraphSecurityRunHuntingQuery/MicrosoftGraphSecurityRunHuntingQueryRequestBuilder.cs index 113bfe13c1..b8fbfbb079 100644 --- a/src/generated/Security/MicrosoftGraphSecurityRunHuntingQuery/MicrosoftGraphSecurityRunHuntingQueryRequestBuilder.cs +++ b/src/generated/Security/MicrosoftGraphSecurityRunHuntingQuery/MicrosoftGraphSecurityRunHuntingQueryRequestBuilder.cs @@ -22,13 +22,13 @@ namespace ApiSdk.Security.MicrosoftGraphSecurityRunHuntingQuery public class MicrosoftGraphSecurityRunHuntingQueryRequestBuilder : BaseCliRequestBuilder { /// - /// Queries a specified set of event, activity, or entity data supported by Microsoft 365 Defender to proactively look for specific threats in your environment. This is the method for advanced hunting in Microsoft 365 Defender. This method includes a query in Kusto Query Language (KQL). It specifies a data table in the advanced hunting schema and a piped sequence of operators to filter or search that data, and format the query output in specific ways. Find out more about hunting for threats across devices, emails, apps, and identities. Learn about KQL. For information on using advanced hunting in the Microsoft 365 Defender portal, see Proactively hunt for threats with advanced hunting in Microsoft 365 Defender. + /// Queries a specified set of event, activity, or entity data supported by Microsoft 365 Defender to proactively look for specific threats in your environment. This method is for advanced hunting in Microsoft 365 Defender. This method includes a query in Kusto Query Language (KQL). It specifies a data table in the advanced hunting schema and a piped sequence of operators to filter or search that data, and format the query output in specific ways. Find out more about hunting for threats across devices, emails, apps, and identities. Learn about KQL. For information on using advanced hunting in the Microsoft 365 Defender portal, see Proactively hunt for threats with advanced hunting in Microsoft 365 Defender. /// /// A public Command BuildPostCommand() { var command = new Command("post"); - command.Description = "Queries a specified set of event, activity, or entity data supported by Microsoft 365 Defender to proactively look for specific threats in your environment. This is the method for advanced hunting in Microsoft 365 Defender. This method includes a query in Kusto Query Language (KQL). It specifies a data table in the advanced hunting schema and a piped sequence of operators to filter or search that data, and format the query output in specific ways. Find out more about hunting for threats across devices, emails, apps, and identities. Learn about KQL. For information on using advanced hunting in the Microsoft 365 Defender portal, see Proactively hunt for threats with advanced hunting in Microsoft 365 Defender."; + command.Description = "Queries a specified set of event, activity, or entity data supported by Microsoft 365 Defender to proactively look for specific threats in your environment. This method is for advanced hunting in Microsoft 365 Defender. This method includes a query in Kusto Query Language (KQL). It specifies a data table in the advanced hunting schema and a piped sequence of operators to filter or search that data, and format the query output in specific ways. Find out more about hunting for threats across devices, emails, apps, and identities. Learn about KQL. For information on using advanced hunting in the Microsoft 365 Defender portal, see Proactively hunt for threats with advanced hunting in Microsoft 365 Defender."; var bodyOption = new Option("--body", description: "The request body") { }; bodyOption.IsRequired = true; @@ -81,7 +81,7 @@ public MicrosoftGraphSecurityRunHuntingQueryRequestBuilder(string rawUrl) : base { } /// - /// Queries a specified set of event, activity, or entity data supported by Microsoft 365 Defender to proactively look for specific threats in your environment. This is the method for advanced hunting in Microsoft 365 Defender. This method includes a query in Kusto Query Language (KQL). It specifies a data table in the advanced hunting schema and a piped sequence of operators to filter or search that data, and format the query output in specific ways. Find out more about hunting for threats across devices, emails, apps, and identities. Learn about KQL. For information on using advanced hunting in the Microsoft 365 Defender portal, see Proactively hunt for threats with advanced hunting in Microsoft 365 Defender. + /// Queries a specified set of event, activity, or entity data supported by Microsoft 365 Defender to proactively look for specific threats in your environment. This method is for advanced hunting in Microsoft 365 Defender. This method includes a query in Kusto Query Language (KQL). It specifies a data table in the advanced hunting schema and a piped sequence of operators to filter or search that data, and format the query output in specific ways. Find out more about hunting for threats across devices, emails, apps, and identities. Learn about KQL. For information on using advanced hunting in the Microsoft 365 Defender portal, see Proactively hunt for threats with advanced hunting in Microsoft 365 Defender. /// /// A /// The request body diff --git a/src/generated/Sites/SitesRequestBuilder.cs b/src/generated/Sites/SitesRequestBuilder.cs index b136076e00..9470aa4ddb 100644 --- a/src/generated/Sites/SitesRequestBuilder.cs +++ b/src/generated/Sites/SitesRequestBuilder.cs @@ -130,14 +130,14 @@ public Command BuildGetAllSitesNavCommand() return command; } /// - /// List all available sites in an organization. Specific filter criteria and query options are also supported and described below: In addition, you can use a $search query against the /sites collection to find sites matching given keywords.If you want to list all sites across all geographies, refer to getAllSites. For more guidance about building applications that use site discovery for scanning purposes, see Best practices for discovering files and detecting changes at scale. - /// Find more info here + /// Search across a SharePoint tenant for sites that match keywords provided. The only property that works for sorting is createdDateTime. The search filter is a free text search that uses multiple properties when retrieving the search results. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List all available sites in an organization. Specific filter criteria and query options are also supported and described below: In addition, you can use a $search query against the /sites collection to find sites matching given keywords.If you want to list all sites across all geographies, refer to getAllSites. For more guidance about building applications that use site discovery for scanning purposes, see Best practices for discovering files and detecting changes at scale.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/site-list?view=graph-rest-1.0"; + command.Description = "Search across a SharePoint tenant for sites that match keywords provided. The only property that works for sorting is createdDateTime. The search filter is a free text search that uses multiple properties when retrieving the search results.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/site-search?view=graph-rest-1.0"; var topOption = new Option("--top", description: "Show only the first n items") { }; topOption.IsRequired = false; @@ -258,7 +258,7 @@ public SitesRequestBuilder(string rawUrl) : base("{+baseurl}/sites{?%24count,%24 { } /// - /// List all available sites in an organization. Specific filter criteria and query options are also supported and described below: In addition, you can use a $search query against the /sites collection to find sites matching given keywords.If you want to list all sites across all geographies, refer to getAllSites. For more guidance about building applications that use site discovery for scanning purposes, see Best practices for discovering files and detecting changes at scale. + /// Search across a SharePoint tenant for sites that match keywords provided. The only property that works for sorting is createdDateTime. The search filter is a free text search that uses multiple properties when retrieving the search results. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -277,7 +277,7 @@ public RequestInformation ToGetRequestInformation(Action - /// List all available sites in an organization. Specific filter criteria and query options are also supported and described below: In addition, you can use a $search query against the /sites collection to find sites matching given keywords.If you want to list all sites across all geographies, refer to getAllSites. For more guidance about building applications that use site discovery for scanning purposes, see Best practices for discovering files and detecting changes at scale. + /// Search across a SharePoint tenant for sites that match keywords provided. The only property that works for sorting is createdDateTime. The search filter is a free text search that uses multiple properties when retrieving the search results. /// public class SitesRequestBuilderGetQueryParameters { diff --git a/src/generated/Storage/FileStorage/Containers/ContainersRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/ContainersRequestBuilder.cs new file mode 100644 index 0000000000..7d19f2da2a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/ContainersRequestBuilder.cs @@ -0,0 +1,323 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Count; +using ApiSdk.Storage.FileStorage.Containers.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers +{ + /// + /// Provides operations to manage the containers property of the microsoft.graph.fileStorage entity. + /// + public class ContainersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the containers property of the microsoft.graph.fileStorage entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new FileStorageContainerItemRequestBuilder(PathParameters); + commands.Add(builder.BuildActivateNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildDriveNavCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildPermissionsNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create a new fileStorageContainer object. The respective container type identified by containerTypeId must be enabled in the tenant. For delegated calls, the calling user is set as the owner of the fileStorageContainer. + /// Find more info here + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create a new fileStorageContainer object. The respective container type identified by containerTypeId must be enabled in the tenant. For delegated calls, the calling user is set as the owner of the fileStorageContainer. \n\nFind more info here:\n https://learn.microsoft.com/graph/api/filestoragecontainer-post?view=graph-rest-1.0"; + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FileStorageContainer.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Retrieve a list of fileStorageContainer objects that are visible to the caller. The containerTypeId filter parameter is required. + /// Find more info here + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Retrieve a list of fileStorageContainer objects that are visible to the caller. The containerTypeId filter parameter is required.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/filestorage-list-containers?view=graph-rest-1.0"; + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContainersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContainersRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Retrieve a list of fileStorageContainer objects that are visible to the caller. The containerTypeId filter parameter is required. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create a new fileStorageContainer object. The respective container type identified by containerTypeId must be enabled in the tenant. For delegated calls, the calling user is set as the owner of the fileStorageContainer. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FileStorageContainer body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FileStorageContainer body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve a list of fileStorageContainer objects that are visible to the caller. The containerTypeId filter parameter is required. + /// + public class ContainersRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..ea17533080 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Count/CountRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Activate/ActivateRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Activate/ActivateRequestBuilder.cs new file mode 100644 index 0000000000..b09349e8be --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Activate/ActivateRequestBuilder.cs @@ -0,0 +1,85 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Activate +{ + /// + /// Provides operations to call the activate method. + /// + public class ActivateRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action activate + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action activate"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ActivateRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/activate", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ActivateRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/activate", rawUrl) + { + } + /// + /// Invoke action activate + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/BundlesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/BundlesRequestBuilder.cs new file mode 100644 index 0000000000..a6d7ca5f3e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/BundlesRequestBuilder.cs @@ -0,0 +1,329 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Bundles.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Bundles.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Bundles +{ + /// + /// Provides operations to manage the bundles property of the microsoft.graph.drive entity. + /// + public class BundlesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the bundles property of the microsoft.graph.drive entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new DriveItemItemRequestBuilder(PathParameters); + commands.Add(builder.BuildContentNavCommand()); + executables.Add(builder.BuildGetCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to bundles for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to bundles for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Collection of bundles (albums and multi-select-shared sets of items). Only in personal OneDrive. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Collection of bundles (albums and multi-select-shared sets of items). Only in personal OneDrive."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BundlesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/bundles{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BundlesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/bundles{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Collection of bundles (albums and multi-select-shared sets of items). Only in personal OneDrive. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to bundles for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApiSdk.Models.DriveItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApiSdk.Models.DriveItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of bundles (albums and multi-select-shared sets of items). Only in personal OneDrive. + /// + public class BundlesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..763d247846 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Bundles.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/bundles/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/bundles/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/Item/Content/ContentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/Item/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000000..6702d1ac2e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/Item/Content/ContentRequestBuilder.cs @@ -0,0 +1,262 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Bundles.Item.Content +{ + /// + /// Provides operations to manage the media for the storage entity. + /// + public class ContentRequestBuilder : BaseCliRequestBuilder + { + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var formatOption = new Option("--format", description: "Format of the content") { + }; + formatOption.IsRequired = false; + command.AddOption(formatOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var format = invocationContext.ParseResult.GetValueForOption(formatOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(format)) q.QueryParameters.Format = format; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildPutCommand() + { + var command = new Command("put"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var inputFileOption = new Option("--input-file", description: "Binary request body") { + }; + inputFileOption.IsRequired = true; + command.AddOption(inputFileOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var inputFile = invocationContext.ParseResult.GetValueForOption(inputFileOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + if (inputFile is null || !inputFile.Exists) { + Console.Error.WriteLine("No available file to send."); + return; + } + using var stream = inputFile.OpenRead(); + var requestInfo = ToPutRequestInformation(stream, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/bundles/{driveItem%2Did}/content{?%24format*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/bundles/{driveItem%2Did}/content{?%24format*}", rawUrl) + { + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Stream body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Stream body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetStreamContent(body, "application/octet-stream"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + public class ContentRequestBuilderGetQueryParameters + { + /// Format of the content +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("%24format")] + public string Format { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/Item/DriveItemItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/Item/DriveItemItemRequestBuilder.cs new file mode 100644 index 0000000000..f87ee887b2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Bundles/Item/DriveItemItemRequestBuilder.cs @@ -0,0 +1,162 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Bundles.Item.Content; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Bundles.Item +{ + /// + /// Provides operations to manage the bundles property of the microsoft.graph.drive entity. + /// + public class DriveItemItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the media for the storage entity. + /// + /// A + public Command BuildContentNavCommand() + { + var command = new Command("content"); + command.Description = "Provides operations to manage the media for the storage entity."; + var builder = new ContentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPutCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Collection of bundles (albums and multi-select-shared sets of items). Only in personal OneDrive. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Collection of bundles (albums and multi-select-shared sets of items). Only in personal OneDrive."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveItemItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/bundles/{driveItem%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveItemItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/bundles/{driveItem%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Collection of bundles (albums and multi-select-shared sets of items). Only in personal OneDrive. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of bundles (albums and multi-select-shared sets of items). Only in personal OneDrive. + /// + public class DriveItemItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/CreatedByUserRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/CreatedByUserRequestBuilder.cs new file mode 100644 index 0000000000..9db551123d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/CreatedByUserRequestBuilder.cs @@ -0,0 +1,179 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.CreatedByUser.MailboxSettings; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.CreatedByUser.ServiceProvisioningErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.CreatedByUser +{ + /// + /// Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity. + /// + public class CreatedByUserRequestBuilder : BaseCliRequestBuilder + { + /// + /// Identity of the user who created the item. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Identity of the user who created the item. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The mailboxSettings property + /// + /// A + public Command BuildMailboxSettingsNavCommand() + { + var command = new Command("mailbox-settings"); + command.Description = "The mailboxSettings property"; + var builder = new MailboxSettingsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The serviceProvisioningErrors property + /// + /// A + public Command BuildServiceProvisioningErrorsNavCommand() + { + var command = new Command("service-provisioning-errors"); + command.Description = "The serviceProvisioningErrors property"; + var builder = new ServiceProvisioningErrorsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CreatedByUserRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/createdByUser{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CreatedByUserRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/createdByUser{?%24expand,%24select}", rawUrl) + { + } + /// + /// Identity of the user who created the item. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Identity of the user who created the item. Read-only. + /// + public class CreatedByUserRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs new file mode 100644 index 0000000000..2aec51e648 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs @@ -0,0 +1,208 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.CreatedByUser.MailboxSettings +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\createdByUser\mailboxSettings + /// + public class MailboxSettingsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update property mailboxSettings value. + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update property mailboxSettings value."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.MailboxSettings.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MailboxSettingsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/createdByUser/mailboxSettings{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MailboxSettingsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/createdByUser/mailboxSettings{?%24expand,%24select}", rawUrl) + { + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update property mailboxSettings value. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + public class MailboxSettingsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..d0ccea4664 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.CreatedByUser.ServiceProvisioningErrors.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/createdByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/createdByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs new file mode 100644 index 0000000000..d8b7f2ca41 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs @@ -0,0 +1,243 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.CreatedByUser.ServiceProvisioningErrors.Count; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.CreatedByUser.ServiceProvisioningErrors +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\createdByUser\serviceProvisioningErrors + /// + public class ServiceProvisioningErrorsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance)."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ServiceProvisioningErrorsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/createdByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ServiceProvisioningErrorsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/createdByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + public class ServiceProvisioningErrorsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/DriveRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/DriveRequestBuilder.cs new file mode 100644 index 0000000000..957627e8ea --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/DriveRequestBuilder.cs @@ -0,0 +1,533 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Bundles; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.CreatedByUser; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Following; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.LastModifiedByUser; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Recent; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Root; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.SearchWithQ; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.SharedWithMe; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Special; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive +{ + /// + /// Provides operations to manage the drive property of the microsoft.graph.fileStorageContainer entity. + /// + public class DriveRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the bundles property of the microsoft.graph.drive entity. + /// + /// A + public Command BuildBundlesNavCommand() + { + var command = new Command("bundles"); + command.Description = "Provides operations to manage the bundles property of the microsoft.graph.drive entity."; + var builder = new BundlesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity. + /// + /// A + public Command BuildCreatedByUserNavCommand() + { + var command = new Command("created-by-user"); + command.Description = "Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity."; + var builder = new CreatedByUserRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMailboxSettingsNavCommand()); + nonExecCommands.Add(builder.BuildServiceProvisioningErrorsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property drive for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property drive for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the following property of the microsoft.graph.drive entity. + /// + /// A + public Command BuildFollowingNavCommand() + { + var command = new Command("following"); + command.Description = "Provides operations to manage the following property of the microsoft.graph.drive entity."; + var builder = new FollowingRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The drive of the resource fileStorageContainer. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The drive of the resource fileStorageContainer. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the items property of the microsoft.graph.drive entity. + /// + /// A + public Command BuildItemsNavCommand() + { + var command = new Command("items"); + command.Description = "Provides operations to manage the items property of the microsoft.graph.drive entity."; + var builder = new ItemsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity. + /// + /// A + public Command BuildLastModifiedByUserNavCommand() + { + var command = new Command("last-modified-by-user"); + command.Description = "Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity."; + var builder = new LastModifiedByUserRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMailboxSettingsNavCommand()); + nonExecCommands.Add(builder.BuildServiceProvisioningErrorsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the list property of the microsoft.graph.drive entity. + /// + /// A + public Command BuildListNavCommand() + { + var command = new Command("list"); + command.Description = "Provides operations to manage the list property of the microsoft.graph.drive entity."; + var builder = new ListRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildColumnsNavCommand()); + nonExecCommands.Add(builder.BuildContentTypesNavCommand()); + nonExecCommands.Add(builder.BuildCreatedByUserNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildDriveNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildItemsNavCommand()); + nonExecCommands.Add(builder.BuildLastModifiedByUserNavCommand()); + nonExecCommands.Add(builder.BuildOperationsNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildSubscriptionsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property drive in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property drive in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.Drive.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the recent method. + /// + /// A + public Command BuildRecentNavCommand() + { + var command = new Command("recent"); + command.Description = "Provides operations to call the recent method."; + var builder = new RecentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the root property of the microsoft.graph.drive entity. + /// + /// A + public Command BuildRootNavCommand() + { + var command = new Command("root"); + command.Description = "Provides operations to manage the root property of the microsoft.graph.drive entity."; + var builder = new RootRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildContentNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the search method. + /// + /// A + public Command BuildSearchWithQRbCommand() + { + var command = new Command("search-with-q"); + command.Description = "Provides operations to call the search method."; + var builder = new SearchWithQRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sharedWithMe method. + /// + /// A + public Command BuildSharedWithMeNavCommand() + { + var command = new Command("shared-with-me"); + command.Description = "Provides operations to call the sharedWithMe method."; + var builder = new SharedWithMeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the special property of the microsoft.graph.drive entity. + /// + /// A + public Command BuildSpecialNavCommand() + { + var command = new Command("special"); + command.Description = "Provides operations to manage the special property of the microsoft.graph.drive entity."; + var builder = new SpecialRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property drive for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The drive of the resource fileStorageContainer. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property drive in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Drive body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Drive body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The drive of the resource fileStorageContainer. Read-only. + /// + public class DriveRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..72620ac081 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Following.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/following/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/following/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/FollowingRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/FollowingRequestBuilder.cs new file mode 100644 index 0000000000..3c5be632a2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/FollowingRequestBuilder.cs @@ -0,0 +1,257 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Following.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Following.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Following +{ + /// + /// Provides operations to manage the following property of the microsoft.graph.drive entity. + /// + public class FollowingRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the following property of the microsoft.graph.drive entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new DriveItemItemRequestBuilder(PathParameters); + commands.Add(builder.BuildContentNavCommand()); + executables.Add(builder.BuildGetCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The list of items the user is following. Only in OneDrive for Business. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The list of items the user is following. Only in OneDrive for Business."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FollowingRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/following{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FollowingRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/following{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The list of items the user is following. Only in OneDrive for Business. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The list of items the user is following. Only in OneDrive for Business. + /// + public class FollowingRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/Item/Content/ContentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/Item/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000000..7edceb087d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/Item/Content/ContentRequestBuilder.cs @@ -0,0 +1,262 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Following.Item.Content +{ + /// + /// Provides operations to manage the media for the storage entity. + /// + public class ContentRequestBuilder : BaseCliRequestBuilder + { + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var formatOption = new Option("--format", description: "Format of the content") { + }; + formatOption.IsRequired = false; + command.AddOption(formatOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var format = invocationContext.ParseResult.GetValueForOption(formatOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(format)) q.QueryParameters.Format = format; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildPutCommand() + { + var command = new Command("put"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var inputFileOption = new Option("--input-file", description: "Binary request body") { + }; + inputFileOption.IsRequired = true; + command.AddOption(inputFileOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var inputFile = invocationContext.ParseResult.GetValueForOption(inputFileOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + if (inputFile is null || !inputFile.Exists) { + Console.Error.WriteLine("No available file to send."); + return; + } + using var stream = inputFile.OpenRead(); + var requestInfo = ToPutRequestInformation(stream, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/following/{driveItem%2Did}/content{?%24format*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/following/{driveItem%2Did}/content{?%24format*}", rawUrl) + { + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Stream body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Stream body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetStreamContent(body, "application/octet-stream"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + public class ContentRequestBuilderGetQueryParameters + { + /// Format of the content +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("%24format")] + public string Format { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/Item/DriveItemItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/Item/DriveItemItemRequestBuilder.cs new file mode 100644 index 0000000000..15d300679b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Following/Item/DriveItemItemRequestBuilder.cs @@ -0,0 +1,162 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Following.Item.Content; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Following.Item +{ + /// + /// Provides operations to manage the following property of the microsoft.graph.drive entity. + /// + public class DriveItemItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the media for the storage entity. + /// + /// A + public Command BuildContentNavCommand() + { + var command = new Command("content"); + command.Description = "Provides operations to manage the media for the storage entity."; + var builder = new ContentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPutCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The list of items the user is following. Only in OneDrive for Business. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The list of items the user is following. Only in OneDrive for Business."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveItemItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/following/{driveItem%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveItemItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/following/{driveItem%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// The list of items the user is following. Only in OneDrive for Business. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The list of items the user is following. Only in OneDrive for Business. + /// + public class DriveItemItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..025e7ee772 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/AllTime/AllTimeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/AllTime/AllTimeRequestBuilder.cs new file mode 100644 index 0000000000..dddaa47200 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/AllTime/AllTimeRequestBuilder.cs @@ -0,0 +1,142 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.AllTime +{ + /// + /// Provides operations to manage the allTime property of the microsoft.graph.itemAnalytics entity. + /// + public class AllTimeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get allTime from storage + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get allTime from storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AllTimeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/allTime{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AllTimeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/allTime{?%24expand,%24select}", rawUrl) + { + } + /// + /// Get allTime from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get allTime from storage + /// + public class AllTimeRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/AnalyticsRequestBuilder.cs new file mode 100644 index 0000000000..8d0d64537a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/AnalyticsRequestBuilder.cs @@ -0,0 +1,344 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.AllTime; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.LastSevenDays; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics +{ + /// + /// Provides operations to manage the analytics property of the microsoft.graph.driveItem entity. + /// + public class AnalyticsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the allTime property of the microsoft.graph.itemAnalytics entity. + /// + /// A + public Command BuildAllTimeNavCommand() + { + var command = new Command("all-time"); + command.Description = "Provides operations to manage the allTime property of the microsoft.graph.itemAnalytics entity."; + var builder = new AllTimeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property analytics for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property analytics for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Analytics about the view activities that took place on this item. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Analytics about the view activities that took place on this item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the itemActivityStats property of the microsoft.graph.itemAnalytics entity. + /// + /// A + public Command BuildItemActivityStatsNavCommand() + { + var command = new Command("item-activity-stats"); + command.Description = "Provides operations to manage the itemActivityStats property of the microsoft.graph.itemAnalytics entity."; + var builder = new ItemActivityStatsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the lastSevenDays property of the microsoft.graph.itemAnalytics entity. + /// + /// A + public Command BuildLastSevenDaysNavCommand() + { + var command = new Command("last-seven-days"); + command.Description = "Provides operations to manage the lastSevenDays property of the microsoft.graph.itemAnalytics entity."; + var builder = new LastSevenDaysRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property analytics in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property analytics in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ItemAnalytics.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AnalyticsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AnalyticsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property analytics for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Analytics about the view activities that took place on this item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property analytics in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ItemAnalytics body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ItemAnalytics body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Analytics about the view activities that took place on this item. + /// + public class AnalyticsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..554f4cd5d3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/ActivitiesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/ActivitiesRequestBuilder.cs new file mode 100644 index 0000000000..c57804354a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/ActivitiesRequestBuilder.cs @@ -0,0 +1,355 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities +{ + /// + /// Provides operations to manage the activities property of the microsoft.graph.itemActivityStat entity. + /// + public class ActivitiesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the activities property of the microsoft.graph.itemActivityStat entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new ItemActivityItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildDriveItemNavCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to activities for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to activities for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ItemActivity.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Exposes the itemActivities represented in this itemActivityStat resource. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Exposes the itemActivities represented in this itemActivityStat resource."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ActivitiesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ActivitiesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Exposes the itemActivities represented in this itemActivityStat resource. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to activities for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ItemActivity body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ItemActivity body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Exposes the itemActivities represented in this itemActivityStat resource. + /// + public class ActivitiesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..6eff46aa34 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Count/CountRequestBuilder.cs @@ -0,0 +1,137 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Item/DriveItem/Content/ContentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Item/DriveItem/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000000..29968419f0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Item/DriveItem/Content/ContentRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities.Item.DriveItem.Content +{ + /// + /// Provides operations to manage the media for the storage entity. + /// + public class ContentRequestBuilder : BaseCliRequestBuilder + { + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var itemActivityIdOption = new Option("--item-activity-id", description: "The unique identifier of itemActivity") { + }; + itemActivityIdOption.IsRequired = true; + command.AddOption(itemActivityIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var itemActivityId = invocationContext.ParseResult.GetValueForOption(itemActivityIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + if (itemActivityId is not null) requestInfo.PathParameters.Add("itemActivity%2Did", itemActivityId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var itemActivityIdOption = new Option("--item-activity-id", description: "The unique identifier of itemActivity") { + }; + itemActivityIdOption.IsRequired = true; + command.AddOption(itemActivityIdOption); + var formatOption = new Option("--format", description: "Format of the content") { + }; + formatOption.IsRequired = false; + command.AddOption(formatOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var itemActivityId = invocationContext.ParseResult.GetValueForOption(itemActivityIdOption); + var format = invocationContext.ParseResult.GetValueForOption(formatOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(format)) q.QueryParameters.Format = format; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + if (itemActivityId is not null) requestInfo.PathParameters.Add("itemActivity%2Did", itemActivityId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildPutCommand() + { + var command = new Command("put"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var itemActivityIdOption = new Option("--item-activity-id", description: "The unique identifier of itemActivity") { + }; + itemActivityIdOption.IsRequired = true; + command.AddOption(itemActivityIdOption); + var inputFileOption = new Option("--input-file", description: "Binary request body") { + }; + inputFileOption.IsRequired = true; + command.AddOption(inputFileOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var itemActivityId = invocationContext.ParseResult.GetValueForOption(itemActivityIdOption); + var inputFile = invocationContext.ParseResult.GetValueForOption(inputFileOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + if (inputFile is null || !inputFile.Exists) { + Console.Error.WriteLine("No available file to send."); + return; + } + using var stream = inputFile.OpenRead(); + var requestInfo = ToPutRequestInformation(stream, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + if (itemActivityId is not null) requestInfo.PathParameters.Add("itemActivity%2Did", itemActivityId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities/{itemActivity%2Did}/driveItem/content{?%24format*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities/{itemActivity%2Did}/driveItem/content{?%24format*}", rawUrl) + { + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Stream body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Stream body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetStreamContent(body, "application/octet-stream"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + public class ContentRequestBuilderGetQueryParameters + { + /// Format of the content +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("%24format")] + public string Format { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Item/DriveItem/DriveItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Item/DriveItem/DriveItemRequestBuilder.cs new file mode 100644 index 0000000000..c8efe0907d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Item/DriveItem/DriveItemRequestBuilder.cs @@ -0,0 +1,174 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities.Item.DriveItem.Content; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities.Item.DriveItem +{ + /// + /// Provides operations to manage the driveItem property of the microsoft.graph.itemActivity entity. + /// + public class DriveItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the media for the storage entity. + /// + /// A + public Command BuildContentNavCommand() + { + var command = new Command("content"); + command.Description = "Provides operations to manage the media for the storage entity."; + var builder = new ContentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPutCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Exposes the driveItem that was the target of this activity. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Exposes the driveItem that was the target of this activity."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var itemActivityIdOption = new Option("--item-activity-id", description: "The unique identifier of itemActivity") { + }; + itemActivityIdOption.IsRequired = true; + command.AddOption(itemActivityIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var itemActivityId = invocationContext.ParseResult.GetValueForOption(itemActivityIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + if (itemActivityId is not null) requestInfo.PathParameters.Add("itemActivity%2Did", itemActivityId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities/{itemActivity%2Did}/driveItem{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities/{itemActivity%2Did}/driveItem{?%24expand,%24select}", rawUrl) + { + } + /// + /// Exposes the driveItem that was the target of this activity. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Exposes the driveItem that was the target of this activity. + /// + public class DriveItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Item/ItemActivityItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Item/ItemActivityItemRequestBuilder.cs new file mode 100644 index 0000000000..55acac21a9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/Activities/Item/ItemActivityItemRequestBuilder.cs @@ -0,0 +1,340 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities.Item.DriveItem; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities.Item +{ + /// + /// Provides operations to manage the activities property of the microsoft.graph.itemActivityStat entity. + /// + public class ItemActivityItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property activities for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property activities for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var itemActivityIdOption = new Option("--item-activity-id", description: "The unique identifier of itemActivity") { + }; + itemActivityIdOption.IsRequired = true; + command.AddOption(itemActivityIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var itemActivityId = invocationContext.ParseResult.GetValueForOption(itemActivityIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + if (itemActivityId is not null) requestInfo.PathParameters.Add("itemActivity%2Did", itemActivityId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the driveItem property of the microsoft.graph.itemActivity entity. + /// + /// A + public Command BuildDriveItemNavCommand() + { + var command = new Command("drive-item"); + command.Description = "Provides operations to manage the driveItem property of the microsoft.graph.itemActivity entity."; + var builder = new DriveItemRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildContentNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Exposes the itemActivities represented in this itemActivityStat resource. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Exposes the itemActivities represented in this itemActivityStat resource."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var itemActivityIdOption = new Option("--item-activity-id", description: "The unique identifier of itemActivity") { + }; + itemActivityIdOption.IsRequired = true; + command.AddOption(itemActivityIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var itemActivityId = invocationContext.ParseResult.GetValueForOption(itemActivityIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + if (itemActivityId is not null) requestInfo.PathParameters.Add("itemActivity%2Did", itemActivityId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property activities in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property activities in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var itemActivityIdOption = new Option("--item-activity-id", description: "The unique identifier of itemActivity") { + }; + itemActivityIdOption.IsRequired = true; + command.AddOption(itemActivityIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var itemActivityId = invocationContext.ParseResult.GetValueForOption(itemActivityIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ItemActivity.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + if (itemActivityId is not null) requestInfo.PathParameters.Add("itemActivity%2Did", itemActivityId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemActivityItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities/{itemActivity%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemActivityItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}/activities/{itemActivity%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property activities for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Exposes the itemActivities represented in this itemActivityStat resource. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property activities in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ItemActivity body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ItemActivity body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Exposes the itemActivities represented in this itemActivityStat resource. + /// + public class ItemActivityItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/ItemActivityStatItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/ItemActivityStatItemRequestBuilder.cs new file mode 100644 index 0000000000..c8f638cae3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/Item/ItemActivityStatItemRequestBuilder.cs @@ -0,0 +1,326 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item.Activities; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item +{ + /// + /// Provides operations to manage the itemActivityStats property of the microsoft.graph.itemAnalytics entity. + /// + public class ItemActivityStatItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the activities property of the microsoft.graph.itemActivityStat entity. + /// + /// A + public Command BuildActivitiesNavCommand() + { + var command = new Command("activities"); + command.Description = "Provides operations to manage the activities property of the microsoft.graph.itemActivityStat entity."; + var builder = new ActivitiesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property itemActivityStats for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property itemActivityStats for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get itemActivityStats from storage + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get itemActivityStats from storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property itemActivityStats in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property itemActivityStats in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var itemActivityStatIdOption = new Option("--item-activity-stat-id", description: "The unique identifier of itemActivityStat") { + }; + itemActivityStatIdOption.IsRequired = true; + command.AddOption(itemActivityStatIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var itemActivityStatId = invocationContext.ParseResult.GetValueForOption(itemActivityStatIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ItemActivityStat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (itemActivityStatId is not null) requestInfo.PathParameters.Add("itemActivityStat%2Did", itemActivityStatId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemActivityStatItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemActivityStatItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats/{itemActivityStat%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property itemActivityStats for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get itemActivityStats from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property itemActivityStats in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ItemActivityStat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ItemActivityStat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get itemActivityStats from storage + /// + public class ItemActivityStatItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/ItemActivityStatsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/ItemActivityStatsRequestBuilder.cs new file mode 100644 index 0000000000..7a0b857120 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/ItemActivityStats/ItemActivityStatsRequestBuilder.cs @@ -0,0 +1,343 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.ItemActivityStats +{ + /// + /// Provides operations to manage the itemActivityStats property of the microsoft.graph.itemAnalytics entity. + /// + public class ItemActivityStatsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the itemActivityStats property of the microsoft.graph.itemAnalytics entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new ItemActivityStatItemRequestBuilder(PathParameters); + commands.Add(builder.BuildActivitiesNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to itemActivityStats for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to itemActivityStats for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ItemActivityStat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Get itemActivityStats from storage + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Get itemActivityStats from storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemActivityStatsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemActivityStatsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/itemActivityStats{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get itemActivityStats from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to itemActivityStats for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ItemActivityStat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ItemActivityStat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get itemActivityStats from storage + /// + public class ItemActivityStatsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/LastSevenDays/LastSevenDaysRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/LastSevenDays/LastSevenDaysRequestBuilder.cs new file mode 100644 index 0000000000..efd9217de3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Analytics/LastSevenDays/LastSevenDaysRequestBuilder.cs @@ -0,0 +1,142 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics.LastSevenDays +{ + /// + /// Provides operations to manage the lastSevenDays property of the microsoft.graph.itemAnalytics entity. + /// + public class LastSevenDaysRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get lastSevenDays from storage + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get lastSevenDays from storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LastSevenDaysRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/lastSevenDays{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LastSevenDaysRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/analytics/lastSevenDays{?%24expand,%24select}", rawUrl) + { + } + /// + /// Get lastSevenDays from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get lastSevenDays from storage + /// + public class LastSevenDaysRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/AssignSensitivityLabel/AssignSensitivityLabelPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/AssignSensitivityLabel/AssignSensitivityLabelPostRequestBody.cs new file mode 100644 index 0000000000..5dbbaaa166 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/AssignSensitivityLabel/AssignSensitivityLabelPostRequestBody.cs @@ -0,0 +1,77 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.AssignSensitivityLabel +{ + #pragma warning disable CS1591 + public class AssignSensitivityLabelPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The assignmentMethod property + public SensitivityLabelAssignmentMethod? AssignmentMethod { get; set; } + /// The justificationText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? JustificationText { get; set; } +#nullable restore +#else + public string JustificationText { get; set; } +#endif + /// The sensitivityLabelId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SensitivityLabelId { get; set; } +#nullable restore +#else + public string SensitivityLabelId { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AssignSensitivityLabelPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AssignSensitivityLabelPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AssignSensitivityLabelPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "assignmentMethod", n => { AssignmentMethod = n.GetEnumValue(); } }, + { "justificationText", n => { JustificationText = n.GetStringValue(); } }, + { "sensitivityLabelId", n => { SensitivityLabelId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("assignmentMethod", AssignmentMethod); + writer.WriteStringValue("justificationText", JustificationText); + writer.WriteStringValue("sensitivityLabelId", SensitivityLabelId); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/AssignSensitivityLabel/AssignSensitivityLabelRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/AssignSensitivityLabel/AssignSensitivityLabelRequestBuilder.cs new file mode 100644 index 0000000000..5912e03c3e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/AssignSensitivityLabel/AssignSensitivityLabelRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.AssignSensitivityLabel +{ + /// + /// Provides operations to call the assignSensitivityLabel method. + /// + public class AssignSensitivityLabelRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action assignSensitivityLabel + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action assignSensitivityLabel"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AssignSensitivityLabelPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AssignSensitivityLabelRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/assignSensitivityLabel", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AssignSensitivityLabelRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/assignSensitivityLabel", rawUrl) + { + } + /// + /// Invoke action assignSensitivityLabel + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AssignSensitivityLabelPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AssignSensitivityLabelPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Checkin/CheckinPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Checkin/CheckinPostRequestBody.cs new file mode 100644 index 0000000000..b0093a7638 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Checkin/CheckinPostRequestBody.cs @@ -0,0 +1,72 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Checkin +{ + #pragma warning disable CS1591 + public class CheckinPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The checkInAs property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CheckInAs { get; set; } +#nullable restore +#else + public string CheckInAs { get; set; } +#endif + /// The comment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Comment { get; set; } +#nullable restore +#else + public string Comment { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CheckinPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CheckinPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CheckinPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "checkInAs", n => { CheckInAs = n.GetStringValue(); } }, + { "comment", n => { Comment = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("checkInAs", CheckInAs); + writer.WriteStringValue("comment", Comment); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Checkin/CheckinRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Checkin/CheckinRequestBuilder.cs new file mode 100644 index 0000000000..368c587291 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Checkin/CheckinRequestBuilder.cs @@ -0,0 +1,107 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Checkin +{ + /// + /// Provides operations to call the checkin method. + /// + public class CheckinRequestBuilder : BaseCliRequestBuilder + { + /// + /// Check in a checked out driveItem resource, which makes the version of the document available to others. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Check in a checked out driveItem resource, which makes the version of the document available to others.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-checkin?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CheckinPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CheckinRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/checkin", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CheckinRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/checkin", rawUrl) + { + } + /// + /// Check in a checked out driveItem resource, which makes the version of the document available to others. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CheckinPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CheckinPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Checkout/CheckoutRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Checkout/CheckoutRequestBuilder.cs new file mode 100644 index 0000000000..2bb77a6d43 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Checkout/CheckoutRequestBuilder.cs @@ -0,0 +1,92 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Checkout +{ + /// + /// Provides operations to call the checkout method. + /// + public class CheckoutRequestBuilder : BaseCliRequestBuilder + { + /// + /// Check out a driveItem resource to prevent others from editing the document, and prevent your changes from being visible until the documented is checked in. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Check out a driveItem resource to prevent others from editing the document, and prevent your changes from being visible until the documented is checked in.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-checkout?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CheckoutRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/checkout", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CheckoutRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/checkout", rawUrl) + { + } + /// + /// Check out a driveItem resource to prevent others from editing the document, and prevent your changes from being visible until the documented is checked in. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/ChildrenRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/ChildrenRequestBuilder.cs new file mode 100644 index 0000000000..ccd459a423 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/ChildrenRequestBuilder.cs @@ -0,0 +1,341 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Children.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Children.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Children +{ + /// + /// Provides operations to manage the children property of the microsoft.graph.driveItem entity. + /// + public class ChildrenRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the children property of the microsoft.graph.driveItem entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Children.Item.DriveItemItemRequestBuilder(PathParameters); + commands.Add(builder.BuildContentNavCommand()); + executables.Add(builder.BuildGetCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to children for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to children for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ChildrenRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/children{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ChildrenRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/children{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to children for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApiSdk.Models.DriveItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApiSdk.Models.DriveItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. + /// + public class ChildrenRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..fcec3c5016 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Children.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/children/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/children/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/Item/Content/ContentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/Item/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000000..f58595cc1c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/Item/Content/ContentRequestBuilder.cs @@ -0,0 +1,280 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Children.Item.Content +{ + /// + /// Provides operations to manage the media for the storage entity. + /// + public class ContentRequestBuilder : BaseCliRequestBuilder + { + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemId1Option = new Option("--drive-item-id1", description: "The unique identifier of driveItem") { + }; + driveItemId1Option.IsRequired = true; + command.AddOption(driveItemId1Option); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemId1 = invocationContext.ParseResult.GetValueForOption(driveItemId1Option); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemId1 is not null) requestInfo.PathParameters.Add("driveItem%2Did1", driveItemId1); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemId1Option = new Option("--drive-item-id1", description: "The unique identifier of driveItem") { + }; + driveItemId1Option.IsRequired = true; + command.AddOption(driveItemId1Option); + var formatOption = new Option("--format", description: "Format of the content") { + }; + formatOption.IsRequired = false; + command.AddOption(formatOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemId1 = invocationContext.ParseResult.GetValueForOption(driveItemId1Option); + var format = invocationContext.ParseResult.GetValueForOption(formatOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(format)) q.QueryParameters.Format = format; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemId1 is not null) requestInfo.PathParameters.Add("driveItem%2Did1", driveItemId1); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildPutCommand() + { + var command = new Command("put"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemId1Option = new Option("--drive-item-id1", description: "The unique identifier of driveItem") { + }; + driveItemId1Option.IsRequired = true; + command.AddOption(driveItemId1Option); + var inputFileOption = new Option("--input-file", description: "Binary request body") { + }; + inputFileOption.IsRequired = true; + command.AddOption(inputFileOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemId1 = invocationContext.ParseResult.GetValueForOption(driveItemId1Option); + var inputFile = invocationContext.ParseResult.GetValueForOption(inputFileOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + if (inputFile is null || !inputFile.Exists) { + Console.Error.WriteLine("No available file to send."); + return; + } + using var stream = inputFile.OpenRead(); + var requestInfo = ToPutRequestInformation(stream, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemId1 is not null) requestInfo.PathParameters.Add("driveItem%2Did1", driveItemId1); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/children/{driveItem%2Did1}/content{?%24format*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/children/{driveItem%2Did1}/content{?%24format*}", rawUrl) + { + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Stream body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Stream body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetStreamContent(body, "application/octet-stream"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + public class ContentRequestBuilderGetQueryParameters + { + /// Format of the content +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("%24format")] + public string Format { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/Item/DriveItemItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/Item/DriveItemItemRequestBuilder.cs new file mode 100644 index 0000000000..e9050ef230 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Children/Item/DriveItemItemRequestBuilder.cs @@ -0,0 +1,168 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Children.Item.Content; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Children.Item +{ + /// + /// Provides operations to manage the children property of the microsoft.graph.driveItem entity. + /// + public class DriveItemItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the media for the storage entity. + /// + /// A + public Command BuildContentNavCommand() + { + var command = new Command("content"); + command.Description = "Provides operations to manage the media for the storage entity."; + var builder = new ContentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPutCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemId1Option = new Option("--drive-item-id1", description: "The unique identifier of driveItem") { + }; + driveItemId1Option.IsRequired = true; + command.AddOption(driveItemId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemId1 = invocationContext.ParseResult.GetValueForOption(driveItemId1Option); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemId1 is not null) requestInfo.PathParameters.Add("driveItem%2Did1", driveItemId1); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveItemItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/children/{driveItem%2Did1}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveItemItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/children/{driveItem%2Did1}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable. + /// + public class DriveItemItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Content/ContentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000000..d8bd6939c9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Content/ContentRequestBuilder.cs @@ -0,0 +1,262 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Content +{ + /// + /// Provides operations to manage the media for the storage entity. + /// + public class ContentRequestBuilder : BaseCliRequestBuilder + { + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var formatOption = new Option("--format", description: "Format of the content") { + }; + formatOption.IsRequired = false; + command.AddOption(formatOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var format = invocationContext.ParseResult.GetValueForOption(formatOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(format)) q.QueryParameters.Format = format; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildPutCommand() + { + var command = new Command("put"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var inputFileOption = new Option("--input-file", description: "Binary request body") { + }; + inputFileOption.IsRequired = true; + command.AddOption(inputFileOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var inputFile = invocationContext.ParseResult.GetValueForOption(inputFileOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + if (inputFile is null || !inputFile.Exists) { + Console.Error.WriteLine("No available file to send."); + return; + } + using var stream = inputFile.OpenRead(); + var requestInfo = ToPutRequestInformation(stream, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/content{?%24format*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/content{?%24format*}", rawUrl) + { + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Stream body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Stream body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetStreamContent(body, "application/octet-stream"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + public class ContentRequestBuilderGetQueryParameters + { + /// Format of the content +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("%24format")] + public string Format { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Copy/CopyPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Copy/CopyPostRequestBody.cs new file mode 100644 index 0000000000..09017ccfdb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Copy/CopyPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Copy +{ + #pragma warning disable CS1591 + public class CopyPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The parentReference property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ItemReference? ParentReference { get; set; } +#nullable restore +#else + public ItemReference ParentReference { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CopyPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CopyPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CopyPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "parentReference", n => { ParentReference = n.GetObjectValue(ItemReference.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("parentReference", ParentReference); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Copy/CopyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Copy/CopyRequestBuilder.cs new file mode 100644 index 0000000000..6ca0aee9b9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Copy/CopyRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Copy +{ + /// + /// Provides operations to call the copy method. + /// + public class CopyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Asynchronously creates a copy of an driveItem (including any children), under a new parent item or with a new name. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Asynchronously creates a copy of an driveItem (including any children), under a new parent item or with a new name.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-copy?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CopyPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CopyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/copy", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CopyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/copy", rawUrl) + { + } + /// + /// Asynchronously creates a copy of an driveItem (including any children), under a new parent item or with a new name. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CopyPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CopyPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateLink/CreateLinkPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateLink/CreateLinkPostRequestBody.cs new file mode 100644 index 0000000000..fcf9894c19 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateLink/CreateLinkPostRequestBody.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreateLink +{ + #pragma warning disable CS1591 + public class CreateLinkPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The expirationDateTime property + public DateTimeOffset? ExpirationDateTime { get; set; } + /// The message property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// The password property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// The recipients property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Recipients { get; set; } +#nullable restore +#else + public List Recipients { get; set; } +#endif + /// The retainInheritedPermissions property + public bool? RetainInheritedPermissions { get; set; } + /// The scope property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Scope { get; set; } +#nullable restore +#else + public string Scope { get; set; } +#endif + /// The sendNotification property + public bool? SendNotification { get; set; } + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CreateLinkPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CreateLinkPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateLinkPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "expirationDateTime", n => { ExpirationDateTime = n.GetDateTimeOffsetValue(); } }, + { "message", n => { Message = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "recipients", n => { Recipients = n.GetCollectionOfObjectValues(DriveRecipient.CreateFromDiscriminatorValue)?.ToList(); } }, + { "retainInheritedPermissions", n => { RetainInheritedPermissions = n.GetBoolValue(); } }, + { "scope", n => { Scope = n.GetStringValue(); } }, + { "sendNotification", n => { SendNotification = n.GetBoolValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("expirationDateTime", ExpirationDateTime); + writer.WriteStringValue("message", Message); + writer.WriteStringValue("password", Password); + writer.WriteCollectionOfObjectValues("recipients", Recipients); + writer.WriteBoolValue("retainInheritedPermissions", RetainInheritedPermissions); + writer.WriteStringValue("scope", Scope); + writer.WriteBoolValue("sendNotification", SendNotification); + writer.WriteStringValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateLink/CreateLinkRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateLink/CreateLinkRequestBuilder.cs new file mode 100644 index 0000000000..964fd27276 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateLink/CreateLinkRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreateLink +{ + /// + /// Provides operations to call the createLink method. + /// + public class CreateLinkRequestBuilder : BaseCliRequestBuilder + { + /// + /// You can use createLink action to share a DriveItem via a sharing link. The createLink action will create a new sharing link if the specified link type doesn't already exist for the calling application.If a sharing link of the specified type already exists for the app, the existing sharing link will be returned. DriveItem resources inherit sharing permissions from their ancestors. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "You can use createLink action to share a DriveItem via a sharing link. The createLink action will create a new sharing link if the specified link type doesn't already exist for the calling application.If a sharing link of the specified type already exists for the app, the existing sharing link will be returned. DriveItem resources inherit sharing permissions from their ancestors.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-createlink?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CreateLinkPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CreateLinkRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createLink", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CreateLinkRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createLink", rawUrl) + { + } + /// + /// You can use createLink action to share a DriveItem via a sharing link. The createLink action will create a new sharing link if the specified link type doesn't already exist for the calling application.If a sharing link of the specified type already exists for the app, the existing sharing link will be returned. DriveItem resources inherit sharing permissions from their ancestors. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateLinkPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateLinkPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateUploadSession/CreateUploadSessionPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateUploadSession/CreateUploadSessionPostRequestBody.cs new file mode 100644 index 0000000000..3daa8078c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateUploadSession/CreateUploadSessionPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreateUploadSession +{ + #pragma warning disable CS1591 + public class CreateUploadSessionPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The item property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public DriveItemUploadableProperties? Item { get; set; } +#nullable restore +#else + public DriveItemUploadableProperties Item { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CreateUploadSessionPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CreateUploadSessionPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateUploadSessionPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "item", n => { Item = n.GetObjectValue(DriveItemUploadableProperties.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("item", Item); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateUploadSession/CreateUploadSessionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateUploadSession/CreateUploadSessionRequestBuilder.cs new file mode 100644 index 0000000000..22e39f82f8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreateUploadSession/CreateUploadSessionRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreateUploadSession +{ + /// + /// Provides operations to call the createUploadSession method. + /// + public class CreateUploadSessionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action createUploadSession + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action createUploadSession"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CreateUploadSessionPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CreateUploadSessionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createUploadSession", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CreateUploadSessionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createUploadSession", rawUrl) + { + } + /// + /// Invoke action createUploadSession + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateUploadSessionPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateUploadSessionPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/CreatedByUserRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/CreatedByUserRequestBuilder.cs new file mode 100644 index 0000000000..f3dd9c0ff0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/CreatedByUserRequestBuilder.cs @@ -0,0 +1,185 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreatedByUser.MailboxSettings; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreatedByUser.ServiceProvisioningErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreatedByUser +{ + /// + /// Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity. + /// + public class CreatedByUserRequestBuilder : BaseCliRequestBuilder + { + /// + /// Identity of the user who created the item. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Identity of the user who created the item. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The mailboxSettings property + /// + /// A + public Command BuildMailboxSettingsNavCommand() + { + var command = new Command("mailbox-settings"); + command.Description = "The mailboxSettings property"; + var builder = new MailboxSettingsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The serviceProvisioningErrors property + /// + /// A + public Command BuildServiceProvisioningErrorsNavCommand() + { + var command = new Command("service-provisioning-errors"); + command.Description = "The serviceProvisioningErrors property"; + var builder = new ServiceProvisioningErrorsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CreatedByUserRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createdByUser{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CreatedByUserRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createdByUser{?%24expand,%24select}", rawUrl) + { + } + /// + /// Identity of the user who created the item. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Identity of the user who created the item. Read-only. + /// + public class CreatedByUserRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs new file mode 100644 index 0000000000..fe9a0903d6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs @@ -0,0 +1,220 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreatedByUser.MailboxSettings +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\items\{driveItem-id}\createdByUser\mailboxSettings + /// + public class MailboxSettingsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update property mailboxSettings value. + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update property mailboxSettings value."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.MailboxSettings.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MailboxSettingsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createdByUser/mailboxSettings{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MailboxSettingsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createdByUser/mailboxSettings{?%24expand,%24select}", rawUrl) + { + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update property mailboxSettings value. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + public class MailboxSettingsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..e6451ff2d9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreatedByUser.ServiceProvisioningErrors.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createdByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createdByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs new file mode 100644 index 0000000000..78704041ae --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs @@ -0,0 +1,249 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreatedByUser.ServiceProvisioningErrors.Count; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreatedByUser.ServiceProvisioningErrors +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\items\{driveItem-id}\createdByUser\serviceProvisioningErrors + /// + public class ServiceProvisioningErrorsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance)."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ServiceProvisioningErrorsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createdByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ServiceProvisioningErrorsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/createdByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + public class ServiceProvisioningErrorsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Delta/DeltaGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Delta/DeltaGetResponse.cs new file mode 100644 index 0000000000..179261827f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Delta/DeltaGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Delta +{ + #pragma warning disable CS1591 + public class DeltaGetResponse : BaseDeltaFunctionResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new DeltaGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeltaGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Delta/DeltaRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Delta/DeltaRequestBuilder.cs new file mode 100644 index 0000000000..0cc403e0ea --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Delta/DeltaRequestBuilder.cs @@ -0,0 +1,231 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Delta +{ + /// + /// Provides operations to call the delta method. + /// + public class DeltaRequestBuilder : BaseCliRequestBuilder + { + /// + /// Track changes in a driveItem and its children over time. Your app begins by calling delta without any parameters.The service starts enumerating the drive's hierarchy, returning pages of items and either an @odata.nextLink or an @odata.deltaLink, as described below.Your app should continue calling with the @odata.nextLink until you no longer see an @odata.nextLink returned, or you see a response with an empty set of changes. After you have finished receiving all the changes, you may apply them to your local state.To check for changes in the future, call delta again with the @odata.deltaLink from the previous response. Deleted items are returned with the deleted facet.Items with this property set should be removed from your local state. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Track changes in a driveItem and its children over time. Your app begins by calling delta without any parameters.The service starts enumerating the drive's hierarchy, returning pages of items and either an @odata.nextLink or an @odata.deltaLink, as described below.Your app should continue calling with the @odata.nextLink until you no longer see an @odata.nextLink returned, or you see a response with an empty set of changes. After you have finished receiving all the changes, you may apply them to your local state.To check for changes in the future, call delta again with the @odata.deltaLink from the previous response. Deleted items are returned with the deleted facet.Items with this property set should be removed from your local state.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-delta?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DeltaRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/delta(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DeltaRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/delta(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Track changes in a driveItem and its children over time. Your app begins by calling delta without any parameters.The service starts enumerating the drive's hierarchy, returning pages of items and either an @odata.nextLink or an @odata.deltaLink, as described below.Your app should continue calling with the @odata.nextLink until you no longer see an @odata.nextLink returned, or you see a response with an empty set of changes. After you have finished receiving all the changes, you may apply them to your local state.To check for changes in the future, call delta again with the @odata.deltaLink from the previous response. Deleted items are returned with the deleted facet.Items with this property set should be removed from your local state. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Track changes in a driveItem and its children over time. Your app begins by calling delta without any parameters.The service starts enumerating the drive's hierarchy, returning pages of items and either an @odata.nextLink or an @odata.deltaLink, as described below.Your app should continue calling with the @odata.nextLink until you no longer see an @odata.nextLink returned, or you see a response with an empty set of changes. After you have finished receiving all the changes, you may apply them to your local state.To check for changes in the future, call delta again with the @odata.deltaLink from the previous response. Deleted items are returned with the deleted facet.Items with this property set should be removed from your local state. + /// + public class DeltaRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/DeltaWithToken/DeltaWithTokenGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/DeltaWithToken/DeltaWithTokenGetResponse.cs new file mode 100644 index 0000000000..717c0fe3e8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/DeltaWithToken/DeltaWithTokenGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.DeltaWithToken +{ + #pragma warning disable CS1591 + public class DeltaWithTokenGetResponse : BaseDeltaFunctionResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new DeltaWithTokenGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeltaWithTokenGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/DeltaWithToken/DeltaWithTokenRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/DeltaWithToken/DeltaWithTokenRequestBuilder.cs new file mode 100644 index 0000000000..02065d2693 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/DeltaWithToken/DeltaWithTokenRequestBuilder.cs @@ -0,0 +1,236 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.DeltaWithToken +{ + /// + /// Provides operations to call the delta method. + /// + public class DeltaWithTokenRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function delta + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function delta"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var tokenOption = new Option("--token", description: "Usage: token='{token}'") { + }; + tokenOption.IsRequired = true; + command.AddOption(tokenOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var token = invocationContext.ParseResult.GetValueForOption(tokenOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (token is not null) requestInfo.PathParameters.Add("token", token); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DeltaWithTokenRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/delta(token='{token}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DeltaWithTokenRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/delta(token='{token}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Invoke function delta + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Invoke function delta + /// + public class DeltaWithTokenRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/DriveItemItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/DriveItemItemRequestBuilder.cs new file mode 100644 index 0000000000..e9ccb8c65a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/DriveItemItemRequestBuilder.cs @@ -0,0 +1,935 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Analytics; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.AssignSensitivityLabel; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Checkin; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Checkout; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Children; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Content; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Copy; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreateLink; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreateUploadSession; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.CreatedByUser; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Delta; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.DeltaWithToken; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.ExtractSensitivityLabels; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Follow; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.GetActivitiesByInterval; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Invite; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.LastModifiedByUser; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.ListItem; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.PermanentDelete; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Preview; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Restore; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.RetentionLabel; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.SearchWithQ; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Subscriptions; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Thumbnails; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Unfollow; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.ValidatePermission; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item +{ + /// + /// Provides operations to manage the items property of the microsoft.graph.drive entity. + /// + public class DriveItemItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the analytics property of the microsoft.graph.driveItem entity. + /// + /// A + public Command BuildAnalyticsNavCommand() + { + var command = new Command("analytics"); + command.Description = "Provides operations to manage the analytics property of the microsoft.graph.driveItem entity."; + var builder = new AnalyticsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAllTimeNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildItemActivityStatsNavCommand()); + nonExecCommands.Add(builder.BuildLastSevenDaysNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the assignSensitivityLabel method. + /// + /// A + public Command BuildAssignSensitivityLabelNavCommand() + { + var command = new Command("assign-sensitivity-label"); + command.Description = "Provides operations to call the assignSensitivityLabel method."; + var builder = new AssignSensitivityLabelRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the checkin method. + /// + /// A + public Command BuildCheckinNavCommand() + { + var command = new Command("checkin"); + command.Description = "Provides operations to call the checkin method."; + var builder = new CheckinRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the checkout method. + /// + /// A + public Command BuildCheckoutNavCommand() + { + var command = new Command("checkout"); + command.Description = "Provides operations to call the checkout method."; + var builder = new CheckoutRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the children property of the microsoft.graph.driveItem entity. + /// + /// A + public Command BuildChildrenNavCommand() + { + var command = new Command("children"); + command.Description = "Provides operations to manage the children property of the microsoft.graph.driveItem entity."; + var builder = new ChildrenRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the media for the storage entity. + /// + /// A + public Command BuildContentNavCommand() + { + var command = new Command("content"); + command.Description = "Provides operations to manage the media for the storage entity."; + var builder = new ContentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPutCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the copy method. + /// + /// A + public Command BuildCopyNavCommand() + { + var command = new Command("copy"); + command.Description = "Provides operations to call the copy method."; + var builder = new CopyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity. + /// + /// A + public Command BuildCreatedByUserNavCommand() + { + var command = new Command("created-by-user"); + command.Description = "Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity."; + var builder = new CreatedByUserRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMailboxSettingsNavCommand()); + nonExecCommands.Add(builder.BuildServiceProvisioningErrorsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the createLink method. + /// + /// A + public Command BuildCreateLinkNavCommand() + { + var command = new Command("create-link"); + command.Description = "Provides operations to call the createLink method."; + var builder = new CreateLinkRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the createUploadSession method. + /// + /// A + public Command BuildCreateUploadSessionNavCommand() + { + var command = new Command("create-upload-session"); + command.Description = "Provides operations to call the createUploadSession method."; + var builder = new CreateUploadSessionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property items for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property items for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to call the delta method. + /// + /// A + public Command BuildDeltaNavCommand() + { + var command = new Command("delta"); + command.Description = "Provides operations to call the delta method."; + var builder = new DeltaRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the delta method. + /// + /// A + public Command BuildDeltaWithTokenRbCommand() + { + var command = new Command("delta-with-token"); + command.Description = "Provides operations to call the delta method."; + var builder = new DeltaWithTokenRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the extractSensitivityLabels method. + /// + /// A + public Command BuildExtractSensitivityLabelsNavCommand() + { + var command = new Command("extract-sensitivity-labels"); + command.Description = "Provides operations to call the extractSensitivityLabels method."; + var builder = new ExtractSensitivityLabelsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the follow method. + /// + /// A + public Command BuildFollowNavCommand() + { + var command = new Command("follow"); + command.Description = "Provides operations to call the follow method."; + var builder = new FollowRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the getActivitiesByInterval method. + /// + /// A + public Command BuildGetActivitiesByIntervalNavCommand() + { + var command = new Command("get-activities-by-interval"); + command.Description = "Provides operations to call the getActivitiesByInterval method."; + var builder = new GetActivitiesByIntervalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the getActivitiesByInterval method. + /// + /// A + public Command BuildGetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRbCommand() + { + var command = new Command("get-activities-by-interval-with-start-date-time-with-end-date-time-with-interval"); + command.Description = "Provides operations to call the getActivitiesByInterval method."; + var builder = new GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// All items contained in the drive. Read-only. Nullable. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "All items contained in the drive. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the invite method. + /// + /// A + public Command BuildInviteNavCommand() + { + var command = new Command("invite"); + command.Description = "Provides operations to call the invite method."; + var builder = new InviteRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity. + /// + /// A + public Command BuildLastModifiedByUserNavCommand() + { + var command = new Command("last-modified-by-user"); + command.Description = "Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity."; + var builder = new LastModifiedByUserRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMailboxSettingsNavCommand()); + nonExecCommands.Add(builder.BuildServiceProvisioningErrorsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the listItem property of the microsoft.graph.driveItem entity. + /// + /// A + public Command BuildListItemNavCommand() + { + var command = new Command("list-item"); + command.Description = "Provides operations to manage the listItem property of the microsoft.graph.driveItem entity."; + var builder = new ListItemRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property items in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property items in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the permanentDelete method. + /// + /// A + public Command BuildPermanentDeleteNavCommand() + { + var command = new Command("permanent-delete"); + command.Description = "Provides operations to call the permanentDelete method."; + var builder = new PermanentDeleteRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the permissions property of the microsoft.graph.driveItem entity. + /// + /// A + public Command BuildPermissionsNavCommand() + { + var command = new Command("permissions"); + command.Description = "Provides operations to manage the permissions property of the microsoft.graph.driveItem entity."; + var builder = new PermissionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the preview method. + /// + /// A + public Command BuildPreviewNavCommand() + { + var command = new Command("preview"); + command.Description = "Provides operations to call the preview method."; + var builder = new PreviewRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the restore method. + /// + /// A + public Command BuildRestoreNavCommand() + { + var command = new Command("restore"); + command.Description = "Provides operations to call the restore method."; + var builder = new RestoreRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the retentionLabel property of the microsoft.graph.driveItem entity. + /// + /// A + public Command BuildRetentionLabelNavCommand() + { + var command = new Command("retention-label"); + command.Description = "Provides operations to manage the retentionLabel property of the microsoft.graph.driveItem entity."; + var builder = new RetentionLabelRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the search method. + /// + /// A + public Command BuildSearchWithQRbCommand() + { + var command = new Command("search-with-q"); + command.Description = "Provides operations to call the search method."; + var builder = new SearchWithQRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity. + /// + /// A + public Command BuildSubscriptionsNavCommand() + { + var command = new Command("subscriptions"); + command.Description = "Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity."; + var builder = new SubscriptionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the thumbnails property of the microsoft.graph.driveItem entity. + /// + /// A + public Command BuildThumbnailsNavCommand() + { + var command = new Command("thumbnails"); + command.Description = "Provides operations to manage the thumbnails property of the microsoft.graph.driveItem entity."; + var builder = new ThumbnailsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the unfollow method. + /// + /// A + public Command BuildUnfollowNavCommand() + { + var command = new Command("unfollow"); + command.Description = "Provides operations to call the unfollow method."; + var builder = new UnfollowRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the validatePermission method. + /// + /// A + public Command BuildValidatePermissionNavCommand() + { + var command = new Command("validate-permission"); + command.Description = "Provides operations to call the validatePermission method."; + var builder = new ValidatePermissionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the versions property of the microsoft.graph.driveItem entity. + /// + /// A + public Command BuildVersionsNavCommand() + { + var command = new Command("versions"); + command.Description = "Provides operations to manage the versions property of the microsoft.graph.driveItem entity."; + var builder = new VersionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the workbook property of the microsoft.graph.driveItem entity. + /// + /// A + public Command BuildWorkbookNavCommand() + { + var command = new Command("workbook"); + command.Description = "Provides operations to manage the workbook property of the microsoft.graph.driveItem entity."; + var builder = new WorkbookRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildApplicationNavCommand()); + nonExecCommands.Add(builder.BuildCloseSessionNavCommand()); + nonExecCommands.Add(builder.BuildCommentsNavCommand()); + nonExecCommands.Add(builder.BuildCreateSessionNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFunctionsNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildNamesNavCommand()); + nonExecCommands.Add(builder.BuildOperationsNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildRefreshSessionNavCommand()); + nonExecCommands.Add(builder.BuildSessionInfoResourceWithKeyRbCommand()); + nonExecCommands.Add(builder.BuildTableRowOperationResultWithKeyRbCommand()); + nonExecCommands.Add(builder.BuildTablesNavCommand()); + nonExecCommands.Add(builder.BuildWorksheetsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveItemItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveItemItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property items for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// All items contained in the drive. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property items in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.DriveItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.DriveItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// All items contained in the drive. Read-only. Nullable. + /// + public class DriveItemItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ExtractSensitivityLabels/ExtractSensitivityLabelsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ExtractSensitivityLabels/ExtractSensitivityLabelsRequestBuilder.cs new file mode 100644 index 0000000000..448ba32cd0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ExtractSensitivityLabels/ExtractSensitivityLabelsRequestBuilder.cs @@ -0,0 +1,102 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.ExtractSensitivityLabels +{ + /// + /// Provides operations to call the extractSensitivityLabels method. + /// + public class ExtractSensitivityLabelsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action extractSensitivityLabels + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action extractSensitivityLabels"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ExtractSensitivityLabelsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/extractSensitivityLabels", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ExtractSensitivityLabelsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/extractSensitivityLabels", rawUrl) + { + } + /// + /// Invoke action extractSensitivityLabels + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Follow/FollowRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Follow/FollowRequestBuilder.cs new file mode 100644 index 0000000000..5562e0fd8a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Follow/FollowRequestBuilder.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Follow +{ + /// + /// Provides operations to call the follow method. + /// + public class FollowRequestBuilder : BaseCliRequestBuilder + { + /// + /// Follow a driveItem. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Follow a driveItem.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-follow?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FollowRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/follow", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FollowRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/follow", rawUrl) + { + } + /// + /// Follow a driveItem. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalGetResponse.cs new file mode 100644 index 0000000000..d9eb520950 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.GetActivitiesByInterval +{ + #pragma warning disable CS1591 + public class GetActivitiesByIntervalGetResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new GetActivitiesByIntervalGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GetActivitiesByIntervalGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ItemActivityStat.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs new file mode 100644 index 0000000000..a17c6ec78c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -0,0 +1,231 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.GetActivitiesByInterval +{ + /// + /// Provides operations to call the getActivitiesByInterval method. + /// + public class GetActivitiesByIntervalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get a collection of itemActivityStats resources for the activities that took place on this resource within the specified time interval. Analytics aggregates might not be available for all action types. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get a collection of itemActivityStats resources for the activities that took place on this resource within the specified time interval. Analytics aggregates might not be available for all action types.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/itemactivitystat-getactivitybyinterval?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GetActivitiesByIntervalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/getActivitiesByInterval(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GetActivitiesByIntervalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/getActivitiesByInterval(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get a collection of itemActivityStats resources for the activities that took place on this resource within the specified time interval. Analytics aggregates might not be available for all action types. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get a collection of itemActivityStats resources for the activities that took place on this resource within the specified time interval. Analytics aggregates might not be available for all action types. + /// + public class GetActivitiesByIntervalRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse.cs new file mode 100644 index 0000000000..201020fc77 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval +{ + #pragma warning disable CS1591 + public class GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ItemActivityStat.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs new file mode 100644 index 0000000000..5e1bb0d2f9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -0,0 +1,248 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval +{ + /// + /// Provides operations to call the getActivitiesByInterval method. + /// + public class GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function getActivitiesByInterval + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function getActivitiesByInterval"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime='{startDateTime}'") { + }; + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime='{endDateTime}'") { + }; + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval='{interval}'") { + }; + intervalOption.IsRequired = true; + command.AddOption(intervalOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var startDateTime = invocationContext.ParseResult.GetValueForOption(startDateTimeOption); + var endDateTime = invocationContext.ParseResult.GetValueForOption(endDateTimeOption); + var interval = invocationContext.ParseResult.GetValueForOption(intervalOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (startDateTime is not null) requestInfo.PathParameters.Add("startDateTime", startDateTime); + if (endDateTime is not null) requestInfo.PathParameters.Add("endDateTime", endDateTime); + if (interval is not null) requestInfo.PathParameters.Add("interval", interval); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/getActivitiesByInterval(startDateTime='{startDateTime}',endDateTime='{endDateTime}',interval='{interval}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/getActivitiesByInterval(startDateTime='{startDateTime}',endDateTime='{endDateTime}',interval='{interval}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Invoke function getActivitiesByInterval + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Invoke function getActivitiesByInterval + /// + public class GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Invite/InvitePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Invite/InvitePostRequestBody.cs new file mode 100644 index 0000000000..736f27e029 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Invite/InvitePostRequestBody.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Invite +{ + #pragma warning disable CS1591 + public class InvitePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The expirationDateTime property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExpirationDateTime { get; set; } +#nullable restore +#else + public string ExpirationDateTime { get; set; } +#endif + /// The message property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// The password property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// The recipients property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Recipients { get; set; } +#nullable restore +#else + public List Recipients { get; set; } +#endif + /// The requireSignIn property + public bool? RequireSignIn { get; set; } + /// The retainInheritedPermissions property + public bool? RetainInheritedPermissions { get; set; } + /// The roles property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Roles { get; set; } +#nullable restore +#else + public List Roles { get; set; } +#endif + /// The sendInvitation property + public bool? SendInvitation { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public InvitePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static InvitePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new InvitePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "expirationDateTime", n => { ExpirationDateTime = n.GetStringValue(); } }, + { "message", n => { Message = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "recipients", n => { Recipients = n.GetCollectionOfObjectValues(DriveRecipient.CreateFromDiscriminatorValue)?.ToList(); } }, + { "requireSignIn", n => { RequireSignIn = n.GetBoolValue(); } }, + { "retainInheritedPermissions", n => { RetainInheritedPermissions = n.GetBoolValue(); } }, + { "roles", n => { Roles = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + { "sendInvitation", n => { SendInvitation = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("expirationDateTime", ExpirationDateTime); + writer.WriteStringValue("message", Message); + writer.WriteStringValue("password", Password); + writer.WriteCollectionOfObjectValues("recipients", Recipients); + writer.WriteBoolValue("requireSignIn", RequireSignIn); + writer.WriteBoolValue("retainInheritedPermissions", RetainInheritedPermissions); + writer.WriteCollectionOfPrimitiveValues("roles", Roles); + writer.WriteBoolValue("sendInvitation", SendInvitation); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Invite/InvitePostResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Invite/InvitePostResponse.cs new file mode 100644 index 0000000000..bcd14534bd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Invite/InvitePostResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Invite +{ + #pragma warning disable CS1591 + public class InvitePostResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new InvitePostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new InvitePostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.Permission.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Invite/InviteRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Invite/InviteRequestBuilder.cs new file mode 100644 index 0000000000..703c81f975 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Invite/InviteRequestBuilder.cs @@ -0,0 +1,130 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Invite +{ + /// + /// Provides operations to call the invite method. + /// + public class InviteRequestBuilder : BaseCliRequestBuilder + { + /// + /// Sends a sharing invitation for a driveItem.A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Sends a sharing invitation for a driveItem.A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-invite?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(InvitePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public InviteRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/invite", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public InviteRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/invite", rawUrl) + { + } + /// + /// Sends a sharing invitation for a driveItem.A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(InvitePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(InvitePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs new file mode 100644 index 0000000000..7443a489db --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs @@ -0,0 +1,185 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.LastModifiedByUser.MailboxSettings; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.LastModifiedByUser.ServiceProvisioningErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.LastModifiedByUser +{ + /// + /// Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity. + /// + public class LastModifiedByUserRequestBuilder : BaseCliRequestBuilder + { + /// + /// Identity of the user who last modified the item. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Identity of the user who last modified the item. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The mailboxSettings property + /// + /// A + public Command BuildMailboxSettingsNavCommand() + { + var command = new Command("mailbox-settings"); + command.Description = "The mailboxSettings property"; + var builder = new MailboxSettingsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The serviceProvisioningErrors property + /// + /// A + public Command BuildServiceProvisioningErrorsNavCommand() + { + var command = new Command("service-provisioning-errors"); + command.Description = "The serviceProvisioningErrors property"; + var builder = new ServiceProvisioningErrorsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LastModifiedByUserRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/lastModifiedByUser{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LastModifiedByUserRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/lastModifiedByUser{?%24expand,%24select}", rawUrl) + { + } + /// + /// Identity of the user who last modified the item. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Identity of the user who last modified the item. Read-only. + /// + public class LastModifiedByUserRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs new file mode 100644 index 0000000000..bc38396a4b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs @@ -0,0 +1,220 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.LastModifiedByUser.MailboxSettings +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\items\{driveItem-id}\lastModifiedByUser\mailboxSettings + /// + public class MailboxSettingsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update property mailboxSettings value. + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update property mailboxSettings value."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.MailboxSettings.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MailboxSettingsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/lastModifiedByUser/mailboxSettings{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MailboxSettingsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/lastModifiedByUser/mailboxSettings{?%24expand,%24select}", rawUrl) + { + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update property mailboxSettings value. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + public class MailboxSettingsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..b6d988f855 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.LastModifiedByUser.ServiceProvisioningErrors.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/lastModifiedByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/lastModifiedByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs new file mode 100644 index 0000000000..8153906165 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs @@ -0,0 +1,249 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.LastModifiedByUser.ServiceProvisioningErrors.Count; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.LastModifiedByUser.ServiceProvisioningErrors +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\items\{driveItem-id}\lastModifiedByUser\serviceProvisioningErrors + /// + public class ServiceProvisioningErrorsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance)."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ServiceProvisioningErrorsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/lastModifiedByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ServiceProvisioningErrorsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/lastModifiedByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + public class ServiceProvisioningErrorsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ListItem/ListItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ListItem/ListItemRequestBuilder.cs new file mode 100644 index 0000000000..f9c500dfb6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ListItem/ListItemRequestBuilder.cs @@ -0,0 +1,142 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.ListItem +{ + /// + /// Provides operations to manage the listItem property of the microsoft.graph.driveItem entity. + /// + public class ListItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// For drives in SharePoint, the associated document library list item. Read-only. Nullable. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "For drives in SharePoint, the associated document library list item. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ListItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/listItem{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ListItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/listItem{?%24expand,%24select}", rawUrl) + { + } + /// + /// For drives in SharePoint, the associated document library list item. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// For drives in SharePoint, the associated document library list item. Read-only. Nullable. + /// + public class ListItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/PermanentDelete/PermanentDeleteRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/PermanentDelete/PermanentDeleteRequestBuilder.cs new file mode 100644 index 0000000000..6ff983090a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/PermanentDelete/PermanentDeleteRequestBuilder.cs @@ -0,0 +1,91 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.PermanentDelete +{ + /// + /// Provides operations to call the permanentDelete method. + /// + public class PermanentDeleteRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action permanentDelete + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action permanentDelete"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PermanentDeleteRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permanentDelete", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PermanentDeleteRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permanentDelete", rawUrl) + { + } + /// + /// Invoke action permanentDelete + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..bcb8ec8bac --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permissions/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permissions/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/Grant/GrantPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/Grant/GrantPostRequestBody.cs new file mode 100644 index 0000000000..c5a2df8222 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/Grant/GrantPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions.Item.Grant +{ + #pragma warning disable CS1591 + public class GrantPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The recipients property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Recipients { get; set; } +#nullable restore +#else + public List Recipients { get; set; } +#endif + /// The roles property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Roles { get; set; } +#nullable restore +#else + public List Roles { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GrantPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static GrantPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GrantPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "recipients", n => { Recipients = n.GetCollectionOfObjectValues(DriveRecipient.CreateFromDiscriminatorValue)?.ToList(); } }, + { "roles", n => { Roles = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("recipients", Recipients); + writer.WriteCollectionOfPrimitiveValues("roles", Roles); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/Grant/GrantPostResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/Grant/GrantPostResponse.cs new file mode 100644 index 0000000000..8c708c24be --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/Grant/GrantPostResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions.Item.Grant +{ + #pragma warning disable CS1591 + public class GrantPostResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new GrantPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GrantPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.Permission.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/Grant/GrantRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/Grant/GrantRequestBuilder.cs new file mode 100644 index 0000000000..8b5a1fd121 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/Grant/GrantRequestBuilder.cs @@ -0,0 +1,136 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions.Item.Grant +{ + /// + /// Provides operations to call the grant method. + /// + public class GrantRequestBuilder : BaseCliRequestBuilder + { + /// + /// Grant users access to a link represented by a permission. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Grant users access to a link represented by a permission.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/permission-grant?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var permissionIdOption = new Option("--permission-id", description: "The unique identifier of permission") { + }; + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var permissionId = invocationContext.ParseResult.GetValueForOption(permissionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(GrantPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (permissionId is not null) requestInfo.PathParameters.Add("permission%2Did", permissionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GrantRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permissions/{permission%2Did}/grant", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GrantRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permissions/{permission%2Did}/grant", rawUrl) + { + } + /// + /// Grant users access to a link represented by a permission. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GrantPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GrantPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/PermissionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/PermissionItemRequestBuilder.cs new file mode 100644 index 0000000000..a9f21910cf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/Item/PermissionItemRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions.Item.Grant; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions.Item +{ + /// + /// Provides operations to manage the permissions property of the microsoft.graph.driveItem entity. + /// + public class PermissionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property permissions for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property permissions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var permissionIdOption = new Option("--permission-id", description: "The unique identifier of permission") { + }; + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var permissionId = invocationContext.ParseResult.GetValueForOption(permissionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (permissionId is not null) requestInfo.PathParameters.Add("permission%2Did", permissionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The set of permissions for the item. Read-only. Nullable. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The set of permissions for the item. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var permissionIdOption = new Option("--permission-id", description: "The unique identifier of permission") { + }; + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var permissionId = invocationContext.ParseResult.GetValueForOption(permissionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (permissionId is not null) requestInfo.PathParameters.Add("permission%2Did", permissionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the grant method. + /// + /// A + public Command BuildGrantNavCommand() + { + var command = new Command("grant"); + command.Description = "Provides operations to call the grant method."; + var builder = new GrantRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property permissions in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property permissions in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var permissionIdOption = new Option("--permission-id", description: "The unique identifier of permission") { + }; + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var permissionId = invocationContext.ParseResult.GetValueForOption(permissionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.Permission.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (permissionId is not null) requestInfo.PathParameters.Add("permission%2Did", permissionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PermissionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permissions/{permission%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PermissionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permissions/{permission%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property permissions for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of permissions for the item. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property permissions in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Permission body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Permission body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of permissions for the item. Read-only. Nullable. + /// + public class PermissionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/PermissionsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/PermissionsRequestBuilder.cs new file mode 100644 index 0000000000..ae27548bc2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Permissions/PermissionsRequestBuilder.cs @@ -0,0 +1,343 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Permissions +{ + /// + /// Provides operations to manage the permissions property of the microsoft.graph.driveItem entity. + /// + public class PermissionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the permissions property of the microsoft.graph.driveItem entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new PermissionItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildGrantNavCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to permissions for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to permissions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.Permission.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The set of permissions for the item. Read-only. Nullable. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The set of permissions for the item. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PermissionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permissions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PermissionsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/permissions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The set of permissions for the item. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to permissions for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApiSdk.Models.Permission body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApiSdk.Models.Permission body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of permissions for the item. Read-only. Nullable. + /// + public class PermissionsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Preview/PreviewPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Preview/PreviewPostRequestBody.cs new file mode 100644 index 0000000000..afba45e5c8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Preview/PreviewPostRequestBody.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Preview +{ + #pragma warning disable CS1591 + public class PreviewPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The page property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Page { get; set; } +#nullable restore +#else + public string Page { get; set; } +#endif + /// The zoom property + public double? Zoom { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public PreviewPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PreviewPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PreviewPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "page", n => { Page = n.GetStringValue(); } }, + { "zoom", n => { Zoom = n.GetDoubleValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("page", Page); + writer.WriteDoubleValue("zoom", Zoom); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Preview/PreviewRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Preview/PreviewRequestBuilder.cs new file mode 100644 index 0000000000..5a0f76954b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Preview/PreviewRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Preview +{ + /// + /// Provides operations to call the preview method. + /// + public class PreviewRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action preview + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action preview"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PreviewPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PreviewRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/preview", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PreviewRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/preview", rawUrl) + { + } + /// + /// Invoke action preview + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PreviewPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PreviewPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Restore/RestorePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Restore/RestorePostRequestBody.cs new file mode 100644 index 0000000000..bcd356dbcf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Restore/RestorePostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Restore +{ + #pragma warning disable CS1591 + public class RestorePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The parentReference property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ItemReference? ParentReference { get; set; } +#nullable restore +#else + public ItemReference ParentReference { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RestorePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RestorePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RestorePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + { "parentReference", n => { ParentReference = n.GetObjectValue(ItemReference.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("parentReference", ParentReference); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Restore/RestoreRequestBuilder.cs new file mode 100644 index 0000000000..b63b3b57b2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Restore/RestoreRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Restore +{ + /// + /// Provides operations to call the restore method. + /// + public class RestoreRequestBuilder : BaseCliRequestBuilder + { + /// + /// Restore a driveItem that has been deleted and is currently in the recycle bin. NOTE: This functionality is currently only available for OneDrive Personal. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Restore a driveItem that has been deleted and is currently in the recycle bin. NOTE: This functionality is currently only available for OneDrive Personal.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-restore?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RestorePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RestoreRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/restore", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RestoreRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/restore", rawUrl) + { + } + /// + /// Restore a driveItem that has been deleted and is currently in the recycle bin. NOTE: This functionality is currently only available for OneDrive Personal. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RestorePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RestorePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/RetentionLabel/RetentionLabelRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/RetentionLabel/RetentionLabelRequestBuilder.cs new file mode 100644 index 0000000000..43c5fb2907 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/RetentionLabel/RetentionLabelRequestBuilder.cs @@ -0,0 +1,280 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.RetentionLabel +{ + /// + /// Provides operations to manage the retentionLabel property of the microsoft.graph.driveItem entity. + /// + public class RetentionLabelRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property retentionLabel for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property retentionLabel for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Information about retention label and settings enforced on the driveItem. Read-write. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Information about retention label and settings enforced on the driveItem. Read-write."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property retentionLabel in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property retentionLabel in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ItemRetentionLabel.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RetentionLabelRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/retentionLabel{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RetentionLabelRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/retentionLabel{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property retentionLabel for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Information about retention label and settings enforced on the driveItem. Read-write. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property retentionLabel in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ItemRetentionLabel body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ItemRetentionLabel body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Information about retention label and settings enforced on the driveItem. Read-write. + /// + public class RetentionLabelRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/SearchWithQ/SearchWithQGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/SearchWithQ/SearchWithQGetResponse.cs new file mode 100644 index 0000000000..0017e55c76 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/SearchWithQ/SearchWithQGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.SearchWithQ +{ + #pragma warning disable CS1591 + public class SearchWithQGetResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new SearchWithQGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SearchWithQGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/SearchWithQ/SearchWithQRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/SearchWithQ/SearchWithQRequestBuilder.cs new file mode 100644 index 0000000000..bda46e4f5c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/SearchWithQ/SearchWithQRequestBuilder.cs @@ -0,0 +1,237 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.SearchWithQ +{ + /// + /// Provides operations to call the search method. + /// + public class SearchWithQRequestBuilder : BaseCliRequestBuilder + { + /// + /// Search the hierarchy of items for items matching a query.You can search within a folder hierarchy, a whole drive, or files shared with the current user. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Search the hierarchy of items for items matching a query.You can search within a folder hierarchy, a whole drive, or files shared with the current user.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-search?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var qOption = new Option("-q", description: "Usage: q='{q}'") { + }; + qOption.IsRequired = true; + command.AddOption(qOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var q = invocationContext.ParseResult.GetValueForOption(qOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (q is not null) requestInfo.PathParameters.Add("q", q); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SearchWithQRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/search(q='{q}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SearchWithQRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/search(q='{q}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Search the hierarchy of items for items matching a query.You can search within a folder hierarchy, a whole drive, or files shared with the current user. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Search the hierarchy of items for items matching a query.You can search within a folder hierarchy, a whole drive, or files shared with the current user. + /// + public class SearchWithQRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..66c6273b3c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Subscriptions.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/subscriptions/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/subscriptions/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/Item/Reauthorize/ReauthorizeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/Item/Reauthorize/ReauthorizeRequestBuilder.cs new file mode 100644 index 0000000000..06d8f403ff --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/Item/Reauthorize/ReauthorizeRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Subscriptions.Item.Reauthorize +{ + /// + /// Provides operations to call the reauthorize method. + /// + public class ReauthorizeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Reauthorize a subscription when you receive a reauthorizationRequired challenge. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Reauthorize a subscription when you receive a reauthorizationRequired challenge.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/subscription-reauthorize?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "The unique identifier of subscription") { + }; + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var subscriptionId = invocationContext.ParseResult.GetValueForOption(subscriptionIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (subscriptionId is not null) requestInfo.PathParameters.Add("subscription%2Did", subscriptionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReauthorizeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/subscriptions/{subscription%2Did}/reauthorize", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReauthorizeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/subscriptions/{subscription%2Did}/reauthorize", rawUrl) + { + } + /// + /// Reauthorize a subscription when you receive a reauthorizationRequired challenge. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/Item/SubscriptionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/Item/SubscriptionItemRequestBuilder.cs new file mode 100644 index 0000000000..379b9ffbf8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/Item/SubscriptionItemRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Subscriptions.Item.Reauthorize; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Subscriptions.Item +{ + /// + /// Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity. + /// + public class SubscriptionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property subscriptions for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property subscriptions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "The unique identifier of subscription") { + }; + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var subscriptionId = invocationContext.ParseResult.GetValueForOption(subscriptionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (subscriptionId is not null) requestInfo.PathParameters.Add("subscription%2Did", subscriptionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The set of subscriptions on the item. Only supported on the root of a drive. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The set of subscriptions on the item. Only supported on the root of a drive."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "The unique identifier of subscription") { + }; + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var subscriptionId = invocationContext.ParseResult.GetValueForOption(subscriptionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (subscriptionId is not null) requestInfo.PathParameters.Add("subscription%2Did", subscriptionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property subscriptions in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property subscriptions in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "The unique identifier of subscription") { + }; + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var subscriptionId = invocationContext.ParseResult.GetValueForOption(subscriptionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Subscription.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (subscriptionId is not null) requestInfo.PathParameters.Add("subscription%2Did", subscriptionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the reauthorize method. + /// + /// A + public Command BuildReauthorizeNavCommand() + { + var command = new Command("reauthorize"); + command.Description = "Provides operations to call the reauthorize method."; + var builder = new ReauthorizeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SubscriptionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/subscriptions/{subscription%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SubscriptionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/subscriptions/{subscription%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property subscriptions for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of subscriptions on the item. Only supported on the root of a drive. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property subscriptions in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(Subscription body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(Subscription body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of subscriptions on the item. Only supported on the root of a drive. + /// + public class SubscriptionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/SubscriptionsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/SubscriptionsRequestBuilder.cs new file mode 100644 index 0000000000..0a7e853fb7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Subscriptions/SubscriptionsRequestBuilder.cs @@ -0,0 +1,343 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Subscriptions.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Subscriptions.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Subscriptions +{ + /// + /// Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity. + /// + public class SubscriptionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new SubscriptionItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildReauthorizeNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to subscriptions for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to subscriptions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Subscription.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The set of subscriptions on the item. Only supported on the root of a drive. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The set of subscriptions on the item. Only supported on the root of a drive."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SubscriptionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/subscriptions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SubscriptionsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/subscriptions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The set of subscriptions on the item. Only supported on the root of a drive. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to subscriptions for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Subscription body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Subscription body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of subscriptions on the item. Only supported on the root of a drive. + /// + public class SubscriptionsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Thumbnails/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Thumbnails/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..7f84dab708 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Thumbnails/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Thumbnails.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/thumbnails/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/thumbnails/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Thumbnails/Item/ThumbnailSetItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Thumbnails/Item/ThumbnailSetItemRequestBuilder.cs new file mode 100644 index 0000000000..02f686655f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Thumbnails/Item/ThumbnailSetItemRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Thumbnails.Item +{ + /// + /// Provides operations to manage the thumbnails property of the microsoft.graph.driveItem entity. + /// + public class ThumbnailSetItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property thumbnails for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property thumbnails for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var thumbnailSetIdOption = new Option("--thumbnail-set-id", description: "The unique identifier of thumbnailSet") { + }; + thumbnailSetIdOption.IsRequired = true; + command.AddOption(thumbnailSetIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var thumbnailSetId = invocationContext.ParseResult.GetValueForOption(thumbnailSetIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (thumbnailSetId is not null) requestInfo.PathParameters.Add("thumbnailSet%2Did", thumbnailSetId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Collection of thumbnailSet objects associated with the item. For more information, see getting thumbnails. Read-only. Nullable. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Collection of thumbnailSet objects associated with the item. For more information, see getting thumbnails. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var thumbnailSetIdOption = new Option("--thumbnail-set-id", description: "The unique identifier of thumbnailSet") { + }; + thumbnailSetIdOption.IsRequired = true; + command.AddOption(thumbnailSetIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var thumbnailSetId = invocationContext.ParseResult.GetValueForOption(thumbnailSetIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (thumbnailSetId is not null) requestInfo.PathParameters.Add("thumbnailSet%2Did", thumbnailSetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property thumbnails in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property thumbnails in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var thumbnailSetIdOption = new Option("--thumbnail-set-id", description: "The unique identifier of thumbnailSet") { + }; + thumbnailSetIdOption.IsRequired = true; + command.AddOption(thumbnailSetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var thumbnailSetId = invocationContext.ParseResult.GetValueForOption(thumbnailSetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ThumbnailSet.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (thumbnailSetId is not null) requestInfo.PathParameters.Add("thumbnailSet%2Did", thumbnailSetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ThumbnailSetItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/thumbnails/{thumbnailSet%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ThumbnailSetItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/thumbnails/{thumbnailSet%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property thumbnails for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of thumbnailSet objects associated with the item. For more information, see getting thumbnails. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property thumbnails in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ThumbnailSet body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ThumbnailSet body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of thumbnailSet objects associated with the item. For more information, see getting thumbnails. Read-only. Nullable. + /// + public class ThumbnailSetItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Thumbnails/ThumbnailsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Thumbnails/ThumbnailsRequestBuilder.cs new file mode 100644 index 0000000000..a32579010c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Thumbnails/ThumbnailsRequestBuilder.cs @@ -0,0 +1,341 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Thumbnails.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Thumbnails.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Thumbnails +{ + /// + /// Provides operations to manage the thumbnails property of the microsoft.graph.driveItem entity. + /// + public class ThumbnailsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the thumbnails property of the microsoft.graph.driveItem entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var builder = new ThumbnailSetItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, new(0)); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to thumbnails for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to thumbnails for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ThumbnailSet.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Collection of thumbnailSet objects associated with the item. For more information, see getting thumbnails. Read-only. Nullable. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Collection of thumbnailSet objects associated with the item. For more information, see getting thumbnails. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ThumbnailsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/thumbnails{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ThumbnailsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/thumbnails{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Collection of thumbnailSet objects associated with the item. For more information, see getting thumbnails. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to thumbnails for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ThumbnailSet body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ThumbnailSet body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of thumbnailSet objects associated with the item. For more information, see getting thumbnails. Read-only. Nullable. + /// + public class ThumbnailsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Unfollow/UnfollowRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Unfollow/UnfollowRequestBuilder.cs new file mode 100644 index 0000000000..ad0528d0d5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Unfollow/UnfollowRequestBuilder.cs @@ -0,0 +1,92 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Unfollow +{ + /// + /// Provides operations to call the unfollow method. + /// + public class UnfollowRequestBuilder : BaseCliRequestBuilder + { + /// + /// Unfollow a driveItem. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Unfollow a driveItem.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-unfollow?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public UnfollowRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/unfollow", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public UnfollowRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/unfollow", rawUrl) + { + } + /// + /// Unfollow a driveItem. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ValidatePermission/ValidatePermissionPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ValidatePermission/ValidatePermissionPostRequestBody.cs new file mode 100644 index 0000000000..d6de9372e7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ValidatePermission/ValidatePermissionPostRequestBody.cs @@ -0,0 +1,72 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.ValidatePermission +{ + #pragma warning disable CS1591 + public class ValidatePermissionPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The challengeToken property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChallengeToken { get; set; } +#nullable restore +#else + public string ChallengeToken { get; set; } +#endif + /// The password property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ValidatePermissionPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ValidatePermissionPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ValidatePermissionPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "challengeToken", n => { ChallengeToken = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("challengeToken", ChallengeToken); + writer.WriteStringValue("password", Password); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ValidatePermission/ValidatePermissionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ValidatePermission/ValidatePermissionRequestBuilder.cs new file mode 100644 index 0000000000..d00698a648 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/ValidatePermission/ValidatePermissionRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.ValidatePermission +{ + /// + /// Provides operations to call the validatePermission method. + /// + public class ValidatePermissionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action validatePermission + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action validatePermission"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ValidatePermissionPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ValidatePermissionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/validatePermission", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ValidatePermissionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/validatePermission", rawUrl) + { + } + /// + /// Invoke action validatePermission + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ValidatePermissionPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ValidatePermissionPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..7cecd49795 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Item/Content/ContentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Item/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000000..0cc788c50e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Item/Content/ContentRequestBuilder.cs @@ -0,0 +1,258 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions.Item.Content +{ + /// + /// Provides operations to manage the media for the storage entity. + /// + public class ContentRequestBuilder : BaseCliRequestBuilder + { + /// + /// The content stream for this version of the item. + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "The content stream for this version of the item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--drive-item-version-id", description: "The unique identifier of driveItemVersion") { + }; + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemVersionId = invocationContext.ParseResult.GetValueForOption(driveItemVersionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemVersionId is not null) requestInfo.PathParameters.Add("driveItemVersion%2Did", driveItemVersionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The content stream for this version of the item. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The content stream for this version of the item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--drive-item-version-id", description: "The unique identifier of driveItemVersion") { + }; + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemVersionId = invocationContext.ParseResult.GetValueForOption(driveItemVersionIdOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemVersionId is not null) requestInfo.PathParameters.Add("driveItemVersion%2Did", driveItemVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// The content stream for this version of the item. + /// + /// A + public Command BuildPutCommand() + { + var command = new Command("put"); + command.Description = "The content stream for this version of the item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--drive-item-version-id", description: "The unique identifier of driveItemVersion") { + }; + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + var inputFileOption = new Option("--input-file", description: "Binary request body") { + }; + inputFileOption.IsRequired = true; + command.AddOption(inputFileOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemVersionId = invocationContext.ParseResult.GetValueForOption(driveItemVersionIdOption); + var inputFile = invocationContext.ParseResult.GetValueForOption(inputFileOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + if (inputFile is null || !inputFile.Exists) { + Console.Error.WriteLine("No available file to send."); + return; + } + using var stream = inputFile.OpenRead(); + var requestInfo = ToPutRequestInformation(stream, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemVersionId is not null) requestInfo.PathParameters.Add("driveItemVersion%2Did", driveItemVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions/{driveItemVersion%2Did}/content", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions/{driveItemVersion%2Did}/content", rawUrl) + { + } + /// + /// The content stream for this version of the item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The content stream for this version of the item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json"); + return requestInfo; + } + /// + /// The content stream for this version of the item. + /// + /// A + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Stream body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Stream body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetStreamContent(body, "application/octet-stream"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Item/DriveItemVersionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Item/DriveItemVersionItemRequestBuilder.cs new file mode 100644 index 0000000000..2faf814595 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Item/DriveItemVersionItemRequestBuilder.cs @@ -0,0 +1,336 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions.Item.Content; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions.Item.RestoreVersion; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions.Item +{ + /// + /// Provides operations to manage the versions property of the microsoft.graph.driveItem entity. + /// + public class DriveItemVersionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the media for the storage entity. + /// + /// A + public Command BuildContentNavCommand() + { + var command = new Command("content"); + command.Description = "Provides operations to manage the media for the storage entity."; + var builder = new ContentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPutCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property versions for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property versions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--drive-item-version-id", description: "The unique identifier of driveItemVersion") { + }; + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemVersionId = invocationContext.ParseResult.GetValueForOption(driveItemVersionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemVersionId is not null) requestInfo.PathParameters.Add("driveItemVersion%2Did", driveItemVersionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The list of previous versions of the item. For more info, see getting previous versions. Read-only. Nullable. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The list of previous versions of the item. For more info, see getting previous versions. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--drive-item-version-id", description: "The unique identifier of driveItemVersion") { + }; + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemVersionId = invocationContext.ParseResult.GetValueForOption(driveItemVersionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemVersionId is not null) requestInfo.PathParameters.Add("driveItemVersion%2Did", driveItemVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property versions in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property versions in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--drive-item-version-id", description: "The unique identifier of driveItemVersion") { + }; + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemVersionId = invocationContext.ParseResult.GetValueForOption(driveItemVersionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DriveItemVersion.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemVersionId is not null) requestInfo.PathParameters.Add("driveItemVersion%2Did", driveItemVersionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the restoreVersion method. + /// + /// A + public Command BuildRestoreVersionNavCommand() + { + var command = new Command("restore-version"); + command.Description = "Provides operations to call the restoreVersion method."; + var builder = new RestoreVersionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveItemVersionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions/{driveItemVersion%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveItemVersionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions/{driveItemVersion%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property versions for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The list of previous versions of the item. For more info, see getting previous versions. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property versions in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(DriveItemVersion body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(DriveItemVersion body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The list of previous versions of the item. For more info, see getting previous versions. Read-only. Nullable. + /// + public class DriveItemVersionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs new file mode 100644 index 0000000000..20ec1b12ca --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions.Item.RestoreVersion +{ + /// + /// Provides operations to call the restoreVersion method. + /// + public class RestoreVersionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Restore a previous version of a DriveItem to be the current version. This will create a new version with the contents of the previous version, but preserves all existing versions of the file. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Restore a previous version of a DriveItem to be the current version. This will create a new version with the contents of the previous version, but preserves all existing versions of the file.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitemversion-restore?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var driveItemVersionIdOption = new Option("--drive-item-version-id", description: "The unique identifier of driveItemVersion") { + }; + driveItemVersionIdOption.IsRequired = true; + command.AddOption(driveItemVersionIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var driveItemVersionId = invocationContext.ParseResult.GetValueForOption(driveItemVersionIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (driveItemVersionId is not null) requestInfo.PathParameters.Add("driveItemVersion%2Did", driveItemVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RestoreVersionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions/{driveItemVersion%2Did}/restoreVersion", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RestoreVersionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions/{driveItemVersion%2Did}/restoreVersion", rawUrl) + { + } + /// + /// Restore a previous version of a DriveItem to be the current version. This will create a new version with the contents of the previous version, but preserves all existing versions of the file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/VersionsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/VersionsRequestBuilder.cs new file mode 100644 index 0000000000..565980e40c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Versions/VersionsRequestBuilder.cs @@ -0,0 +1,344 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Versions +{ + /// + /// Provides operations to manage the versions property of the microsoft.graph.driveItem entity. + /// + public class VersionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the versions property of the microsoft.graph.driveItem entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new DriveItemVersionItemRequestBuilder(PathParameters); + commands.Add(builder.BuildContentNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRestoreVersionNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to versions for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to versions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DriveItemVersion.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The list of previous versions of the item. For more info, see getting previous versions. Read-only. Nullable. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The list of previous versions of the item. For more info, see getting previous versions. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public VersionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public VersionsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/versions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The list of previous versions of the item. For more info, see getting previous versions. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to versions for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DriveItemVersion body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DriveItemVersion body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The list of previous versions of the item. For more info, see getting previous versions. Read-only. Nullable. + /// + public class VersionsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Application/ApplicationRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Application/ApplicationRequestBuilder.cs new file mode 100644 index 0000000000..095fc87b1f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Application/ApplicationRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Application.Calculate; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Application +{ + /// + /// Provides operations to manage the application property of the microsoft.graph.workbook entity. + /// + public class ApplicationRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the calculate method. + /// + /// A + public Command BuildCalculateNavCommand() + { + var command = new Command("calculate"); + command.Description = "Provides operations to call the calculate method."; + var builder = new CalculateRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property application for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property application for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get application from storage + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get application from storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property application in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property application in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookApplication.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplicationRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/application{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplicationRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/application{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property application for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get application from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property application in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookApplication body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookApplication body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get application from storage + /// + public class ApplicationRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Application/Calculate/CalculatePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Application/Calculate/CalculatePostRequestBody.cs new file mode 100644 index 0000000000..2c34b6fa4d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Application/Calculate/CalculatePostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Application.Calculate +{ + #pragma warning disable CS1591 + public class CalculatePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The calculationType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CalculationType { get; set; } +#nullable restore +#else + public string CalculationType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CalculatePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CalculatePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CalculatePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "calculationType", n => { CalculationType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("calculationType", CalculationType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Application/Calculate/CalculateRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Application/Calculate/CalculateRequestBuilder.cs new file mode 100644 index 0000000000..3cccaf66ef --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Application/Calculate/CalculateRequestBuilder.cs @@ -0,0 +1,107 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Application.Calculate +{ + /// + /// Provides operations to call the calculate method. + /// + public class CalculateRequestBuilder : BaseCliRequestBuilder + { + /// + /// Recalculate all currently opened workbooks in Excel. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Recalculate all currently opened workbooks in Excel.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/workbookapplication-calculate?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CalculatePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CalculateRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/application/calculate", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CalculateRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/application/calculate", rawUrl) + { + } + /// + /// Recalculate all currently opened workbooks in Excel. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CalculatePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CalculatePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/CloseSession/CloseSessionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/CloseSession/CloseSessionRequestBuilder.cs new file mode 100644 index 0000000000..dcb13ab687 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/CloseSession/CloseSessionRequestBuilder.cs @@ -0,0 +1,92 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.CloseSession +{ + /// + /// Provides operations to call the closeSession method. + /// + public class CloseSessionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Use this API to close an existing workbook session. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Use this API to close an existing workbook session.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/workbook-closesession?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CloseSessionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/closeSession", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CloseSessionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/closeSession", rawUrl) + { + } + /// + /// Use this API to close an existing workbook session. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/CommentsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/CommentsRequestBuilder.cs new file mode 100644 index 0000000000..6a849b6915 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/CommentsRequestBuilder.cs @@ -0,0 +1,343 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments +{ + /// + /// Provides operations to manage the comments property of the microsoft.graph.workbook entity. + /// + public class CommentsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the comments property of the microsoft.graph.workbook entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookCommentItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRepliesNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to comments for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to comments for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookComment.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Represents a collection of comments in a workbook. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents a collection of comments in a workbook."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CommentsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CommentsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of comments in a workbook. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to comments for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookComment body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookComment body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of comments in a workbook. + /// + public class CommentsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..4d74812a21 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/Replies/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/Replies/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..8bb3547662 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/Replies/Count/CountRequestBuilder.cs @@ -0,0 +1,137 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Item.Replies.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbook-comment-id", description: "The unique identifier of workbookComment") { + }; + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookCommentId = invocationContext.ParseResult.GetValueForOption(workbookCommentIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookCommentId is not null) requestInfo.PathParameters.Add("workbookComment%2Did", workbookCommentId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/{workbookComment%2Did}/replies/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/{workbookComment%2Did}/replies/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/Replies/Item/WorkbookCommentReplyItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/Replies/Item/WorkbookCommentReplyItemRequestBuilder.cs new file mode 100644 index 0000000000..7337ccc1bd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/Replies/Item/WorkbookCommentReplyItemRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Item.Replies.Item +{ + /// + /// Provides operations to manage the replies property of the microsoft.graph.workbookComment entity. + /// + public class WorkbookCommentReplyItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property replies for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property replies for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbook-comment-id", description: "The unique identifier of workbookComment") { + }; + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var workbookCommentReplyIdOption = new Option("--workbook-comment-reply-id", description: "The unique identifier of workbookCommentReply") { + }; + workbookCommentReplyIdOption.IsRequired = true; + command.AddOption(workbookCommentReplyIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookCommentId = invocationContext.ParseResult.GetValueForOption(workbookCommentIdOption); + var workbookCommentReplyId = invocationContext.ParseResult.GetValueForOption(workbookCommentReplyIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookCommentId is not null) requestInfo.PathParameters.Add("workbookComment%2Did", workbookCommentId); + if (workbookCommentReplyId is not null) requestInfo.PathParameters.Add("workbookCommentReply%2Did", workbookCommentReplyId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get replies from storage + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get replies from storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbook-comment-id", description: "The unique identifier of workbookComment") { + }; + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var workbookCommentReplyIdOption = new Option("--workbook-comment-reply-id", description: "The unique identifier of workbookCommentReply") { + }; + workbookCommentReplyIdOption.IsRequired = true; + command.AddOption(workbookCommentReplyIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookCommentId = invocationContext.ParseResult.GetValueForOption(workbookCommentIdOption); + var workbookCommentReplyId = invocationContext.ParseResult.GetValueForOption(workbookCommentReplyIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookCommentId is not null) requestInfo.PathParameters.Add("workbookComment%2Did", workbookCommentId); + if (workbookCommentReplyId is not null) requestInfo.PathParameters.Add("workbookCommentReply%2Did", workbookCommentReplyId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property replies in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property replies in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbook-comment-id", description: "The unique identifier of workbookComment") { + }; + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var workbookCommentReplyIdOption = new Option("--workbook-comment-reply-id", description: "The unique identifier of workbookCommentReply") { + }; + workbookCommentReplyIdOption.IsRequired = true; + command.AddOption(workbookCommentReplyIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookCommentId = invocationContext.ParseResult.GetValueForOption(workbookCommentIdOption); + var workbookCommentReplyId = invocationContext.ParseResult.GetValueForOption(workbookCommentReplyIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookCommentReply.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookCommentId is not null) requestInfo.PathParameters.Add("workbookComment%2Did", workbookCommentId); + if (workbookCommentReplyId is not null) requestInfo.PathParameters.Add("workbookCommentReply%2Did", workbookCommentReplyId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookCommentReplyItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/{workbookComment%2Did}/replies/{workbookCommentReply%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookCommentReplyItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/{workbookComment%2Did}/replies/{workbookCommentReply%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property replies for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get replies from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property replies in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookCommentReply body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookCommentReply body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get replies from storage + /// + public class WorkbookCommentReplyItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/Replies/RepliesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/Replies/RepliesRequestBuilder.cs new file mode 100644 index 0000000000..74be095c78 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/Replies/RepliesRequestBuilder.cs @@ -0,0 +1,353 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Item.Replies.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Item.Replies.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Item.Replies +{ + /// + /// Provides operations to manage the replies property of the microsoft.graph.workbookComment entity. + /// + public class RepliesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the replies property of the microsoft.graph.workbookComment entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var builder = new WorkbookCommentReplyItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, new(0)); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to replies for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to replies for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbook-comment-id", description: "The unique identifier of workbookComment") { + }; + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookCommentId = invocationContext.ParseResult.GetValueForOption(workbookCommentIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookCommentReply.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookCommentId is not null) requestInfo.PathParameters.Add("workbookComment%2Did", workbookCommentId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Get replies from storage + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Get replies from storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbook-comment-id", description: "The unique identifier of workbookComment") { + }; + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookCommentId = invocationContext.ParseResult.GetValueForOption(workbookCommentIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookCommentId is not null) requestInfo.PathParameters.Add("workbookComment%2Did", workbookCommentId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RepliesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/{workbookComment%2Did}/replies{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RepliesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/{workbookComment%2Did}/replies{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get replies from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to replies for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookCommentReply body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookCommentReply body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get replies from storage + /// + public class RepliesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/WorkbookCommentItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/WorkbookCommentItemRequestBuilder.cs new file mode 100644 index 0000000000..3082f642f5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Comments/Item/WorkbookCommentItemRequestBuilder.cs @@ -0,0 +1,326 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Item.Replies; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments.Item +{ + /// + /// Provides operations to manage the comments property of the microsoft.graph.workbook entity. + /// + public class WorkbookCommentItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property comments for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property comments for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbook-comment-id", description: "The unique identifier of workbookComment") { + }; + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookCommentId = invocationContext.ParseResult.GetValueForOption(workbookCommentIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookCommentId is not null) requestInfo.PathParameters.Add("workbookComment%2Did", workbookCommentId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents a collection of comments in a workbook. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of comments in a workbook."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbook-comment-id", description: "The unique identifier of workbookComment") { + }; + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookCommentId = invocationContext.ParseResult.GetValueForOption(workbookCommentIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookCommentId is not null) requestInfo.PathParameters.Add("workbookComment%2Did", workbookCommentId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property comments in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property comments in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookCommentIdOption = new Option("--workbook-comment-id", description: "The unique identifier of workbookComment") { + }; + workbookCommentIdOption.IsRequired = true; + command.AddOption(workbookCommentIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookCommentId = invocationContext.ParseResult.GetValueForOption(workbookCommentIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookComment.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookCommentId is not null) requestInfo.PathParameters.Add("workbookComment%2Did", workbookCommentId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the replies property of the microsoft.graph.workbookComment entity. + /// + /// A + public Command BuildRepliesNavCommand() + { + var command = new Command("replies"); + command.Description = "Provides operations to manage the replies property of the microsoft.graph.workbookComment entity."; + var builder = new RepliesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookCommentItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/{workbookComment%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookCommentItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/comments/{workbookComment%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property comments for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of comments in a workbook. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property comments in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookComment body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookComment body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of comments in a workbook. + /// + public class WorkbookCommentItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/CreateSession/CreateSessionPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/CreateSession/CreateSessionPostRequestBody.cs new file mode 100644 index 0000000000..ca6e072534 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/CreateSession/CreateSessionPostRequestBody.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.CreateSession +{ + #pragma warning disable CS1591 + public class CreateSessionPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The persistChanges property + public bool? PersistChanges { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CreateSessionPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CreateSessionPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateSessionPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "persistChanges", n => { PersistChanges = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("persistChanges", PersistChanges); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/CreateSession/CreateSessionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/CreateSession/CreateSessionRequestBuilder.cs new file mode 100644 index 0000000000..3e213d55a9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/CreateSession/CreateSessionRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.CreateSession +{ + /// + /// Provides operations to call the createSession method. + /// + public class CreateSessionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Create a new workbook session. Excel APIs can be called in one of two modes: To represent the session in the API, use the workbook-session-id: {session-id} header. In some cases, creating a new session requires an indeterminate time to complete. Microsoft Graph also provides a long running operations pattern. This pattern provides a way to poll for creation status updates, without waiting for the creation to complete. The following are the steps: + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Create a new workbook session. Excel APIs can be called in one of two modes: To represent the session in the API, use the workbook-session-id: {session-id} header. In some cases, creating a new session requires an indeterminate time to complete. Microsoft Graph also provides a long running operations pattern. This pattern provides a way to poll for creation status updates, without waiting for the creation to complete. The following are the steps:\n\nFind more info here:\n https://learn.microsoft.com/graph/api/workbook-createsession?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CreateSessionPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CreateSessionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/createSession", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CreateSessionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/createSession", rawUrl) + { + } + /// + /// Create a new workbook session. Excel APIs can be called in one of two modes: To represent the session in the API, use the workbook-session-id: {session-id} header. In some cases, creating a new session requires an indeterminate time to complete. Microsoft Graph also provides a long running operations pattern. This pattern provides a way to poll for creation status updates, without waiting for the creation to complete. The following are the steps: + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateSessionPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateSessionPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Abs/AbsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Abs/AbsPostRequestBody.cs new file mode 100644 index 0000000000..3c535b191e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Abs/AbsPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Abs +{ + #pragma warning disable CS1591 + public class AbsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AbsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AbsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AbsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Abs/AbsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Abs/AbsRequestBuilder.cs new file mode 100644 index 0000000000..29b64ded30 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Abs/AbsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Abs +{ + /// + /// Provides operations to call the abs method. + /// + public class AbsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action abs + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action abs"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AbsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AbsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/abs", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AbsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/abs", rawUrl) + { + } + /// + /// Invoke action abs + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AbsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AbsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrInt/AccrIntPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrInt/AccrIntPostRequestBody.cs new file mode 100644 index 0000000000..cf12ff800f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrInt/AccrIntPostRequestBody.cs @@ -0,0 +1,133 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AccrInt +{ + #pragma warning disable CS1591 + public class AccrIntPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The calcMethod property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? CalcMethod { get; set; } +#nullable restore +#else + public Json CalcMethod { get; set; } +#endif + /// The firstInterest property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FirstInterest { get; set; } +#nullable restore +#else + public Json FirstInterest { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The issue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Issue { get; set; } +#nullable restore +#else + public Json Issue { get; set; } +#endif + /// The par property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Par { get; set; } +#nullable restore +#else + public Json Par { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AccrIntPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AccrIntPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AccrIntPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "calcMethod", n => { CalcMethod = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "firstInterest", n => { FirstInterest = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "issue", n => { Issue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "par", n => { Par = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("calcMethod", CalcMethod); + writer.WriteObjectValue("firstInterest", FirstInterest); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("issue", Issue); + writer.WriteObjectValue("par", Par); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrInt/AccrIntRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrInt/AccrIntRequestBuilder.cs new file mode 100644 index 0000000000..0b0bfcbef5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrInt/AccrIntRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AccrInt +{ + /// + /// Provides operations to call the accrInt method. + /// + public class AccrIntRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action accrInt + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action accrInt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AccrIntPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AccrIntRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/accrInt", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AccrIntRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/accrInt", rawUrl) + { + } + /// + /// Invoke action accrInt + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AccrIntPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AccrIntPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrIntM/AccrIntMPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrIntM/AccrIntMPostRequestBody.cs new file mode 100644 index 0000000000..b622efc231 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrIntM/AccrIntMPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AccrIntM +{ + #pragma warning disable CS1591 + public class AccrIntMPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The issue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Issue { get; set; } +#nullable restore +#else + public Json Issue { get; set; } +#endif + /// The par property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Par { get; set; } +#nullable restore +#else + public Json Par { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AccrIntMPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AccrIntMPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AccrIntMPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "issue", n => { Issue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "par", n => { Par = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("issue", Issue); + writer.WriteObjectValue("par", Par); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrIntM/AccrIntMRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrIntM/AccrIntMRequestBuilder.cs new file mode 100644 index 0000000000..2c747c17d0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AccrIntM/AccrIntMRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AccrIntM +{ + /// + /// Provides operations to call the accrIntM method. + /// + public class AccrIntMRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action accrIntM + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action accrIntM"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AccrIntMPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AccrIntMRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/accrIntM", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AccrIntMRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/accrIntM", rawUrl) + { + } + /// + /// Invoke action accrIntM + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AccrIntMPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AccrIntMPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acos/AcosPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acos/AcosPostRequestBody.cs new file mode 100644 index 0000000000..5d1ce20763 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acos/AcosPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acos +{ + #pragma warning disable CS1591 + public class AcosPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AcosPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AcosPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AcosPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acos/AcosRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acos/AcosRequestBuilder.cs new file mode 100644 index 0000000000..48b13b398a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acos/AcosRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acos +{ + /// + /// Provides operations to call the acos method. + /// + public class AcosRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action acos + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action acos"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AcosPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AcosRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/acos", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AcosRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/acos", rawUrl) + { + } + /// + /// Invoke action acos + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AcosPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AcosPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acosh/AcoshPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acosh/AcoshPostRequestBody.cs new file mode 100644 index 0000000000..d90201c88c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acosh/AcoshPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acosh +{ + #pragma warning disable CS1591 + public class AcoshPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AcoshPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AcoshPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AcoshPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acosh/AcoshRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acosh/AcoshRequestBuilder.cs new file mode 100644 index 0000000000..b76d2db93a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acosh/AcoshRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acosh +{ + /// + /// Provides operations to call the acosh method. + /// + public class AcoshRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action acosh + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action acosh"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AcoshPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AcoshRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/acosh", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AcoshRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/acosh", rawUrl) + { + } + /// + /// Invoke action acosh + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AcoshPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AcoshPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acot/AcotPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acot/AcotPostRequestBody.cs new file mode 100644 index 0000000000..cc9d19484f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acot/AcotPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acot +{ + #pragma warning disable CS1591 + public class AcotPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AcotPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AcotPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AcotPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acot/AcotRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acot/AcotRequestBuilder.cs new file mode 100644 index 0000000000..30e6a817e5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acot/AcotRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acot +{ + /// + /// Provides operations to call the acot method. + /// + public class AcotRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action acot + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action acot"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AcotPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AcotRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/acot", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AcotRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/acot", rawUrl) + { + } + /// + /// Invoke action acot + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AcotPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AcotPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acoth/AcothPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acoth/AcothPostRequestBody.cs new file mode 100644 index 0000000000..764926e525 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acoth/AcothPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acoth +{ + #pragma warning disable CS1591 + public class AcothPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AcothPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AcothPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AcothPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acoth/AcothRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acoth/AcothRequestBuilder.cs new file mode 100644 index 0000000000..9461de71fc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Acoth/AcothRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acoth +{ + /// + /// Provides operations to call the acoth method. + /// + public class AcothRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action acoth + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action acoth"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AcothPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AcothRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/acoth", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AcothRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/acoth", rawUrl) + { + } + /// + /// Invoke action acoth + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AcothPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AcothPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorDegrc/AmorDegrcPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorDegrc/AmorDegrcPostRequestBody.cs new file mode 100644 index 0000000000..4a892ceb17 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorDegrc/AmorDegrcPostRequestBody.cs @@ -0,0 +1,123 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AmorDegrc +{ + #pragma warning disable CS1591 + public class AmorDegrcPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The cost property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cost { get; set; } +#nullable restore +#else + public Json Cost { get; set; } +#endif + /// The datePurchased property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DatePurchased { get; set; } +#nullable restore +#else + public Json DatePurchased { get; set; } +#endif + /// The firstPeriod property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FirstPeriod { get; set; } +#nullable restore +#else + public Json FirstPeriod { get; set; } +#endif + /// The period property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Period { get; set; } +#nullable restore +#else + public Json Period { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The salvage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Salvage { get; set; } +#nullable restore +#else + public Json Salvage { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AmorDegrcPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AmorDegrcPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AmorDegrcPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "cost", n => { Cost = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "datePurchased", n => { DatePurchased = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "firstPeriod", n => { FirstPeriod = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "period", n => { Period = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "salvage", n => { Salvage = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("cost", Cost); + writer.WriteObjectValue("datePurchased", DatePurchased); + writer.WriteObjectValue("firstPeriod", FirstPeriod); + writer.WriteObjectValue("period", Period); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("salvage", Salvage); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorDegrc/AmorDegrcRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorDegrc/AmorDegrcRequestBuilder.cs new file mode 100644 index 0000000000..c13e6b722a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorDegrc/AmorDegrcRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AmorDegrc +{ + /// + /// Provides operations to call the amorDegrc method. + /// + public class AmorDegrcRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action amorDegrc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action amorDegrc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AmorDegrcPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AmorDegrcRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/amorDegrc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AmorDegrcRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/amorDegrc", rawUrl) + { + } + /// + /// Invoke action amorDegrc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AmorDegrcPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AmorDegrcPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorLinc/AmorLincPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorLinc/AmorLincPostRequestBody.cs new file mode 100644 index 0000000000..346c17eac1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorLinc/AmorLincPostRequestBody.cs @@ -0,0 +1,123 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AmorLinc +{ + #pragma warning disable CS1591 + public class AmorLincPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The cost property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cost { get; set; } +#nullable restore +#else + public Json Cost { get; set; } +#endif + /// The datePurchased property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DatePurchased { get; set; } +#nullable restore +#else + public Json DatePurchased { get; set; } +#endif + /// The firstPeriod property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FirstPeriod { get; set; } +#nullable restore +#else + public Json FirstPeriod { get; set; } +#endif + /// The period property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Period { get; set; } +#nullable restore +#else + public Json Period { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The salvage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Salvage { get; set; } +#nullable restore +#else + public Json Salvage { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AmorLincPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AmorLincPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AmorLincPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "cost", n => { Cost = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "datePurchased", n => { DatePurchased = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "firstPeriod", n => { FirstPeriod = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "period", n => { Period = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "salvage", n => { Salvage = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("cost", Cost); + writer.WriteObjectValue("datePurchased", DatePurchased); + writer.WriteObjectValue("firstPeriod", FirstPeriod); + writer.WriteObjectValue("period", Period); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("salvage", Salvage); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorLinc/AmorLincRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorLinc/AmorLincRequestBuilder.cs new file mode 100644 index 0000000000..269b8cf389 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AmorLinc/AmorLincRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AmorLinc +{ + /// + /// Provides operations to call the amorLinc method. + /// + public class AmorLincRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action amorLinc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action amorLinc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AmorLincPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AmorLincRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/amorLinc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AmorLincRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/amorLinc", rawUrl) + { + } + /// + /// Invoke action amorLinc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AmorLincPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AmorLincPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/And/AndPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/And/AndPostRequestBody.cs new file mode 100644 index 0000000000..3e65b9b569 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/And/AndPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.And +{ + #pragma warning disable CS1591 + public class AndPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AndPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AndPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AndPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/And/AndRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/And/AndRequestBuilder.cs new file mode 100644 index 0000000000..2d6d0432c8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/And/AndRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.And +{ + /// + /// Provides operations to call the and method. + /// + public class AndRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action and + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action and"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AndPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AndRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/and", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AndRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/and", rawUrl) + { + } + /// + /// Invoke action and + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AndPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AndPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Arabic/ArabicPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Arabic/ArabicPostRequestBody.cs new file mode 100644 index 0000000000..f86f32d7ab --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Arabic/ArabicPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Arabic +{ + #pragma warning disable CS1591 + public class ArabicPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ArabicPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ArabicPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ArabicPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Arabic/ArabicRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Arabic/ArabicRequestBuilder.cs new file mode 100644 index 0000000000..1ac530e5f9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Arabic/ArabicRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Arabic +{ + /// + /// Provides operations to call the arabic method. + /// + public class ArabicRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action arabic + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action arabic"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ArabicPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ArabicRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/arabic", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ArabicRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/arabic", rawUrl) + { + } + /// + /// Invoke action arabic + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ArabicPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ArabicPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Areas/AreasPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Areas/AreasPostRequestBody.cs new file mode 100644 index 0000000000..75f0d5ef62 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Areas/AreasPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Areas +{ + #pragma warning disable CS1591 + public class AreasPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The reference property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Reference { get; set; } +#nullable restore +#else + public Json Reference { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AreasPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AreasPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AreasPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "reference", n => { Reference = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("reference", Reference); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Areas/AreasRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Areas/AreasRequestBuilder.cs new file mode 100644 index 0000000000..2c4ca58a5d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Areas/AreasRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Areas +{ + /// + /// Provides operations to call the areas method. + /// + public class AreasRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action areas + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action areas"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AreasPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AreasRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/areas", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AreasRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/areas", rawUrl) + { + } + /// + /// Invoke action areas + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AreasPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AreasPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asc/AscPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asc/AscPostRequestBody.cs new file mode 100644 index 0000000000..cb9a573d7f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asc/AscPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Asc +{ + #pragma warning disable CS1591 + public class AscPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AscPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AscPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AscPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asc/AscRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asc/AscRequestBuilder.cs new file mode 100644 index 0000000000..ae2497aecd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asc/AscRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Asc +{ + /// + /// Provides operations to call the asc method. + /// + public class AscRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action asc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action asc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AscPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AscRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/asc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AscRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/asc", rawUrl) + { + } + /// + /// Invoke action asc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AscPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AscPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asin/AsinPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asin/AsinPostRequestBody.cs new file mode 100644 index 0000000000..164aafd3de --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asin/AsinPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Asin +{ + #pragma warning disable CS1591 + public class AsinPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AsinPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AsinPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AsinPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asin/AsinRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asin/AsinRequestBuilder.cs new file mode 100644 index 0000000000..95f833a667 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asin/AsinRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Asin +{ + /// + /// Provides operations to call the asin method. + /// + public class AsinRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action asin + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action asin"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AsinPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AsinRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/asin", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AsinRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/asin", rawUrl) + { + } + /// + /// Invoke action asin + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AsinPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AsinPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asinh/AsinhPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asinh/AsinhPostRequestBody.cs new file mode 100644 index 0000000000..693afc1148 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asinh/AsinhPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Asinh +{ + #pragma warning disable CS1591 + public class AsinhPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AsinhPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AsinhPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AsinhPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asinh/AsinhRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asinh/AsinhRequestBuilder.cs new file mode 100644 index 0000000000..13aedc81b8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Asinh/AsinhRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Asinh +{ + /// + /// Provides operations to call the asinh method. + /// + public class AsinhRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action asinh + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action asinh"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AsinhPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AsinhRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/asinh", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AsinhRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/asinh", rawUrl) + { + } + /// + /// Invoke action asinh + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AsinhPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AsinhPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan/AtanPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan/AtanPostRequestBody.cs new file mode 100644 index 0000000000..eaa43373aa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan/AtanPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Atan +{ + #pragma warning disable CS1591 + public class AtanPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AtanPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AtanPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AtanPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan/AtanRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan/AtanRequestBuilder.cs new file mode 100644 index 0000000000..e1001f9c41 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan/AtanRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Atan +{ + /// + /// Provides operations to call the atan method. + /// + public class AtanRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action atan + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action atan"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AtanPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AtanRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/atan", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AtanRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/atan", rawUrl) + { + } + /// + /// Invoke action atan + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AtanPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AtanPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan2/Atan2PostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan2/Atan2PostRequestBody.cs new file mode 100644 index 0000000000..c1c5966dc6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan2/Atan2PostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Atan2 +{ + #pragma warning disable CS1591 + public class Atan2PostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The xNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? XNum { get; set; } +#nullable restore +#else + public Json XNum { get; set; } +#endif + /// The yNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? YNum { get; set; } +#nullable restore +#else + public Json YNum { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Atan2PostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Atan2PostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Atan2PostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "xNum", n => { XNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "yNum", n => { YNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("xNum", XNum); + writer.WriteObjectValue("yNum", YNum); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan2/Atan2RequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan2/Atan2RequestBuilder.cs new file mode 100644 index 0000000000..57d8725237 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atan2/Atan2RequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Atan2 +{ + /// + /// Provides operations to call the atan2 method. + /// + public class Atan2RequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action atan2 + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action atan2"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Atan2PostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Atan2RequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/atan2", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Atan2RequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/atan2", rawUrl) + { + } + /// + /// Invoke action atan2 + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Atan2PostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Atan2PostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atanh/AtanhPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atanh/AtanhPostRequestBody.cs new file mode 100644 index 0000000000..89312e76b7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atanh/AtanhPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Atanh +{ + #pragma warning disable CS1591 + public class AtanhPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AtanhPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AtanhPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AtanhPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atanh/AtanhRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atanh/AtanhRequestBuilder.cs new file mode 100644 index 0000000000..6e4b5a68b9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Atanh/AtanhRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Atanh +{ + /// + /// Provides operations to call the atanh method. + /// + public class AtanhRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action atanh + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action atanh"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AtanhPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AtanhRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/atanh", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AtanhRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/atanh", rawUrl) + { + } + /// + /// Invoke action atanh + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AtanhPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AtanhPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AveDev/AveDevPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AveDev/AveDevPostRequestBody.cs new file mode 100644 index 0000000000..74ed458f21 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AveDev/AveDevPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AveDev +{ + #pragma warning disable CS1591 + public class AveDevPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AveDevPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AveDevPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AveDevPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AveDev/AveDevRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AveDev/AveDevRequestBuilder.cs new file mode 100644 index 0000000000..f8d4b21de4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AveDev/AveDevRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AveDev +{ + /// + /// Provides operations to call the aveDev method. + /// + public class AveDevRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action aveDev + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action aveDev"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AveDevPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AveDevRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/aveDev", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AveDevRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/aveDev", rawUrl) + { + } + /// + /// Invoke action aveDev + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AveDevPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AveDevPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Average/AveragePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Average/AveragePostRequestBody.cs new file mode 100644 index 0000000000..138999e732 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Average/AveragePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Average +{ + #pragma warning disable CS1591 + public class AveragePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AveragePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AveragePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AveragePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Average/AverageRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Average/AverageRequestBuilder.cs new file mode 100644 index 0000000000..8d1e65d74f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Average/AverageRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Average +{ + /// + /// Provides operations to call the average method. + /// + public class AverageRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action average + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action average"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AveragePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AverageRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/average", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AverageRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/average", rawUrl) + { + } + /// + /// Invoke action average + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AveragePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AveragePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageA/AverageAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageA/AverageAPostRequestBody.cs new file mode 100644 index 0000000000..0bd1986d90 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageA/AverageAPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AverageA +{ + #pragma warning disable CS1591 + public class AverageAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AverageAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AverageAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AverageAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageA/AverageARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageA/AverageARequestBuilder.cs new file mode 100644 index 0000000000..ff4de52e0e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageA/AverageARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AverageA +{ + /// + /// Provides operations to call the averageA method. + /// + public class AverageARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action averageA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action averageA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AverageAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AverageARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/averageA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AverageARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/averageA", rawUrl) + { + } + /// + /// Invoke action averageA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AverageAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AverageAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIf/AverageIfPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIf/AverageIfPostRequestBody.cs new file mode 100644 index 0000000000..3527437ca6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIf/AverageIfPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AverageIf +{ + #pragma warning disable CS1591 + public class AverageIfPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The averageRange property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? AverageRange { get; set; } +#nullable restore +#else + public Json AverageRange { get; set; } +#endif + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The range property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Range { get; set; } +#nullable restore +#else + public Json Range { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AverageIfPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AverageIfPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AverageIfPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "averageRange", n => { AverageRange = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "range", n => { Range = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("averageRange", AverageRange); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("range", Range); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIf/AverageIfRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIf/AverageIfRequestBuilder.cs new file mode 100644 index 0000000000..4fad387e98 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIf/AverageIfRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AverageIf +{ + /// + /// Provides operations to call the averageIf method. + /// + public class AverageIfRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action averageIf + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action averageIf"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AverageIfPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AverageIfRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/averageIf", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AverageIfRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/averageIf", rawUrl) + { + } + /// + /// Invoke action averageIf + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AverageIfPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AverageIfPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIfs/AverageIfsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIfs/AverageIfsPostRequestBody.cs new file mode 100644 index 0000000000..0e6deb3cbc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIfs/AverageIfsPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AverageIfs +{ + #pragma warning disable CS1591 + public class AverageIfsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The averageRange property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? AverageRange { get; set; } +#nullable restore +#else + public Json AverageRange { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AverageIfsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AverageIfsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AverageIfsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "averageRange", n => { AverageRange = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("averageRange", AverageRange); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIfs/AverageIfsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIfs/AverageIfsRequestBuilder.cs new file mode 100644 index 0000000000..bb166f66db --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/AverageIfs/AverageIfsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AverageIfs +{ + /// + /// Provides operations to call the averageIfs method. + /// + public class AverageIfsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action averageIfs + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action averageIfs"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AverageIfsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AverageIfsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/averageIfs", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AverageIfsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/averageIfs", rawUrl) + { + } + /// + /// Invoke action averageIfs + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AverageIfsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AverageIfsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BahtText/BahtTextPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BahtText/BahtTextPostRequestBody.cs new file mode 100644 index 0000000000..1806a0d8a0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BahtText/BahtTextPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BahtText +{ + #pragma warning disable CS1591 + public class BahtTextPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BahtTextPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BahtTextPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BahtTextPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BahtText/BahtTextRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BahtText/BahtTextRequestBuilder.cs new file mode 100644 index 0000000000..5b86ec3804 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BahtText/BahtTextRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BahtText +{ + /// + /// Provides operations to call the bahtText method. + /// + public class BahtTextRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action bahtText + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action bahtText"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BahtTextPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BahtTextRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bahtText", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BahtTextRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bahtText", rawUrl) + { + } + /// + /// Invoke action bahtText + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BahtTextPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BahtTextPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Base/BasePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Base/BasePostRequestBody.cs new file mode 100644 index 0000000000..dc286bf902 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Base/BasePostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Base +{ + #pragma warning disable CS1591 + public class BasePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The minLength property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? MinLength { get; set; } +#nullable restore +#else + public Json MinLength { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The radix property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Radix { get; set; } +#nullable restore +#else + public Json Radix { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BasePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BasePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BasePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "minLength", n => { MinLength = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "radix", n => { Radix = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("minLength", MinLength); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("radix", Radix); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Base/BaseRequestBuilderEscaped.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Base/BaseRequestBuilderEscaped.cs new file mode 100644 index 0000000000..b522189f60 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Base/BaseRequestBuilderEscaped.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Base +{ + /// + /// Provides operations to call the base method. + /// + public class BaseRequestBuilderEscaped : BaseCliRequestBuilder + { + /// + /// Invoke action base + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action base"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BasePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BaseRequestBuilderEscaped(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/base", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BaseRequestBuilderEscaped(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/base", rawUrl) + { + } + /// + /// Invoke action base + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BasePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BasePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselI/BesselIPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselI/BesselIPostRequestBody.cs new file mode 100644 index 0000000000..f14a332ddb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselI/BesselIPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselI +{ + #pragma warning disable CS1591 + public class BesselIPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The n property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? N { get; set; } +#nullable restore +#else + public Json N { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BesselIPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BesselIPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BesselIPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "n", n => { N = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("n", N); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselI/BesselIRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselI/BesselIRequestBuilder.cs new file mode 100644 index 0000000000..4677941b9a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselI/BesselIRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselI +{ + /// + /// Provides operations to call the besselI method. + /// + public class BesselIRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action besselI + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action besselI"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BesselIPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BesselIRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/besselI", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BesselIRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/besselI", rawUrl) + { + } + /// + /// Invoke action besselI + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BesselIPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BesselIPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselJ/BesselJPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselJ/BesselJPostRequestBody.cs new file mode 100644 index 0000000000..1cb44a91c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselJ/BesselJPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselJ +{ + #pragma warning disable CS1591 + public class BesselJPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The n property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? N { get; set; } +#nullable restore +#else + public Json N { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BesselJPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BesselJPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BesselJPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "n", n => { N = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("n", N); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselJ/BesselJRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselJ/BesselJRequestBuilder.cs new file mode 100644 index 0000000000..2e5f3459c2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselJ/BesselJRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselJ +{ + /// + /// Provides operations to call the besselJ method. + /// + public class BesselJRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action besselJ + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action besselJ"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BesselJPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BesselJRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/besselJ", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BesselJRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/besselJ", rawUrl) + { + } + /// + /// Invoke action besselJ + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BesselJPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BesselJPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselK/BesselKPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselK/BesselKPostRequestBody.cs new file mode 100644 index 0000000000..94e8048ef3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselK/BesselKPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselK +{ + #pragma warning disable CS1591 + public class BesselKPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The n property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? N { get; set; } +#nullable restore +#else + public Json N { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BesselKPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BesselKPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BesselKPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "n", n => { N = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("n", N); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselK/BesselKRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselK/BesselKRequestBuilder.cs new file mode 100644 index 0000000000..ec2c48c3af --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselK/BesselKRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselK +{ + /// + /// Provides operations to call the besselK method. + /// + public class BesselKRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action besselK + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action besselK"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BesselKPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BesselKRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/besselK", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BesselKRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/besselK", rawUrl) + { + } + /// + /// Invoke action besselK + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BesselKPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BesselKPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselY/BesselYPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselY/BesselYPostRequestBody.cs new file mode 100644 index 0000000000..95d2a68db4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselY/BesselYPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselY +{ + #pragma warning disable CS1591 + public class BesselYPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The n property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? N { get; set; } +#nullable restore +#else + public Json N { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BesselYPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BesselYPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BesselYPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "n", n => { N = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("n", N); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselY/BesselYRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselY/BesselYRequestBuilder.cs new file mode 100644 index 0000000000..57a5d84ffe --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/BesselY/BesselYRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselY +{ + /// + /// Provides operations to call the besselY method. + /// + public class BesselYRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action besselY + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action besselY"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BesselYPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BesselYRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/besselY", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BesselYRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/besselY", rawUrl) + { + } + /// + /// Invoke action besselY + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BesselYPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BesselYPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Dist/Beta_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Dist/Beta_DistPostRequestBody.cs new file mode 100644 index 0000000000..3144cbb7a0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Dist/Beta_DistPostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Beta_Dist +{ + #pragma warning disable CS1591 + public class Beta_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The A property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? A { get; set; } +#nullable restore +#else + public Json A { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alpha property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Alpha { get; set; } +#nullable restore +#else + public Json Alpha { get; set; } +#endif + /// The B property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? B { get; set; } +#nullable restore +#else + public Json B { get; set; } +#endif + /// The beta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Beta { get; set; } +#nullable restore +#else + public Json Beta { get; set; } +#endif + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Beta_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Beta_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Beta_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "A", n => { A = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "alpha", n => { Alpha = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "B", n => { B = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "beta", n => { Beta = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("A", A); + writer.WriteObjectValue("alpha", Alpha); + writer.WriteObjectValue("B", B); + writer.WriteObjectValue("beta", Beta); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Dist/Beta_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Dist/Beta_DistRequestBuilder.cs new file mode 100644 index 0000000000..1500991f65 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Dist/Beta_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Beta_Dist +{ + /// + /// Provides operations to call the beta_Dist method. + /// + public class Beta_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action beta_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action beta_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Beta_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Beta_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/beta_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Beta_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/beta_Dist", rawUrl) + { + } + /// + /// Invoke action beta_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Beta_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Beta_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Inv/Beta_InvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Inv/Beta_InvPostRequestBody.cs new file mode 100644 index 0000000000..0f7e2a3f60 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Inv/Beta_InvPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Beta_Inv +{ + #pragma warning disable CS1591 + public class Beta_InvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// The A property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? A { get; set; } +#nullable restore +#else + public Json A { get; set; } +#endif + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alpha property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Alpha { get; set; } +#nullable restore +#else + public Json Alpha { get; set; } +#endif + /// The B property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? B { get; set; } +#nullable restore +#else + public Json B { get; set; } +#endif + /// The beta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Beta { get; set; } +#nullable restore +#else + public Json Beta { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Beta_InvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Beta_InvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Beta_InvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "A", n => { A = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "alpha", n => { Alpha = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "B", n => { B = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "beta", n => { Beta = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("A", A); + writer.WriteObjectValue("alpha", Alpha); + writer.WriteObjectValue("B", B); + writer.WriteObjectValue("beta", Beta); + writer.WriteObjectValue("probability", Probability); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Inv/Beta_InvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Inv/Beta_InvRequestBuilder.cs new file mode 100644 index 0000000000..5c26a2d9ea --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Beta_Inv/Beta_InvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Beta_Inv +{ + /// + /// Provides operations to call the beta_Inv method. + /// + public class Beta_InvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action beta_Inv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action beta_Inv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Beta_InvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Beta_InvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/beta_Inv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Beta_InvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/beta_Inv", rawUrl) + { + } + /// + /// Invoke action beta_Inv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Beta_InvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Beta_InvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Dec/Bin2DecPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Dec/Bin2DecPostRequestBody.cs new file mode 100644 index 0000000000..9308da28c8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Dec/Bin2DecPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bin2Dec +{ + #pragma warning disable CS1591 + public class Bin2DecPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Bin2DecPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Bin2DecPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Bin2DecPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Dec/Bin2DecRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Dec/Bin2DecRequestBuilder.cs new file mode 100644 index 0000000000..1d8248058a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Dec/Bin2DecRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bin2Dec +{ + /// + /// Provides operations to call the bin2Dec method. + /// + public class Bin2DecRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action bin2Dec + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action bin2Dec"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Bin2DecPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Bin2DecRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bin2Dec", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Bin2DecRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bin2Dec", rawUrl) + { + } + /// + /// Invoke action bin2Dec + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Bin2DecPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Bin2DecPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Hex/Bin2HexPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Hex/Bin2HexPostRequestBody.cs new file mode 100644 index 0000000000..58b7cb9e32 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Hex/Bin2HexPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bin2Hex +{ + #pragma warning disable CS1591 + public class Bin2HexPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The places property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Places { get; set; } +#nullable restore +#else + public Json Places { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Bin2HexPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Bin2HexPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Bin2HexPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "places", n => { Places = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("places", Places); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Hex/Bin2HexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Hex/Bin2HexRequestBuilder.cs new file mode 100644 index 0000000000..ec80beb071 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Hex/Bin2HexRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bin2Hex +{ + /// + /// Provides operations to call the bin2Hex method. + /// + public class Bin2HexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action bin2Hex + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action bin2Hex"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Bin2HexPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Bin2HexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bin2Hex", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Bin2HexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bin2Hex", rawUrl) + { + } + /// + /// Invoke action bin2Hex + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Bin2HexPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Bin2HexPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Oct/Bin2OctPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Oct/Bin2OctPostRequestBody.cs new file mode 100644 index 0000000000..cfe140a3ee --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Oct/Bin2OctPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bin2Oct +{ + #pragma warning disable CS1591 + public class Bin2OctPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The places property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Places { get; set; } +#nullable restore +#else + public Json Places { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Bin2OctPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Bin2OctPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Bin2OctPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "places", n => { Places = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("places", Places); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Oct/Bin2OctRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Oct/Bin2OctRequestBuilder.cs new file mode 100644 index 0000000000..22288f6b96 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bin2Oct/Bin2OctRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bin2Oct +{ + /// + /// Provides operations to call the bin2Oct method. + /// + public class Bin2OctRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action bin2Oct + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action bin2Oct"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Bin2OctPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Bin2OctRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bin2Oct", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Bin2OctRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bin2Oct", rawUrl) + { + } + /// + /// Invoke action bin2Oct + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Bin2OctPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Bin2OctPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist/Binom_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist/Binom_DistPostRequestBody.cs new file mode 100644 index 0000000000..3172bc24bc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist/Binom_DistPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Binom_Dist +{ + #pragma warning disable CS1591 + public class Binom_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The numberS property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberS { get; set; } +#nullable restore +#else + public Json NumberS { get; set; } +#endif + /// The probabilityS property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ProbabilityS { get; set; } +#nullable restore +#else + public Json ProbabilityS { get; set; } +#endif + /// The trials property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Trials { get; set; } +#nullable restore +#else + public Json Trials { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Binom_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Binom_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Binom_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberS", n => { NumberS = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probabilityS", n => { ProbabilityS = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "trials", n => { Trials = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("numberS", NumberS); + writer.WriteObjectValue("probabilityS", ProbabilityS); + writer.WriteObjectValue("trials", Trials); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist/Binom_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist/Binom_DistRequestBuilder.cs new file mode 100644 index 0000000000..48626dc1c1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist/Binom_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Binom_Dist +{ + /// + /// Provides operations to call the binom_Dist method. + /// + public class Binom_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action binom_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action binom_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Binom_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Binom_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/binom_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Binom_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/binom_Dist", rawUrl) + { + } + /// + /// Invoke action binom_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Binom_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Binom_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangePostRequestBody.cs new file mode 100644 index 0000000000..ca83a6ddcd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangePostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Binom_Dist_Range +{ + #pragma warning disable CS1591 + public class Binom_Dist_RangePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The numberS property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberS { get; set; } +#nullable restore +#else + public Json NumberS { get; set; } +#endif + /// The numberS2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberS2 { get; set; } +#nullable restore +#else + public Json NumberS2 { get; set; } +#endif + /// The probabilityS property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ProbabilityS { get; set; } +#nullable restore +#else + public Json ProbabilityS { get; set; } +#endif + /// The trials property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Trials { get; set; } +#nullable restore +#else + public Json Trials { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Binom_Dist_RangePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Binom_Dist_RangePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Binom_Dist_RangePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numberS", n => { NumberS = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberS2", n => { NumberS2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probabilityS", n => { ProbabilityS = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "trials", n => { Trials = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("numberS", NumberS); + writer.WriteObjectValue("numberS2", NumberS2); + writer.WriteObjectValue("probabilityS", ProbabilityS); + writer.WriteObjectValue("trials", Trials); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangeRequestBuilder.cs new file mode 100644 index 0000000000..e31d028d68 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Dist_Range/Binom_Dist_RangeRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Binom_Dist_Range +{ + /// + /// Provides operations to call the binom_Dist_Range method. + /// + public class Binom_Dist_RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action binom_Dist_Range + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action binom_Dist_Range"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Binom_Dist_RangePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Binom_Dist_RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/binom_Dist_Range", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Binom_Dist_RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/binom_Dist_Range", rawUrl) + { + } + /// + /// Invoke action binom_Dist_Range + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Binom_Dist_RangePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Binom_Dist_RangePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Inv/Binom_InvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Inv/Binom_InvPostRequestBody.cs new file mode 100644 index 0000000000..b5e8976a31 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Inv/Binom_InvPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Binom_Inv +{ + #pragma warning disable CS1591 + public class Binom_InvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alpha property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Alpha { get; set; } +#nullable restore +#else + public Json Alpha { get; set; } +#endif + /// The probabilityS property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ProbabilityS { get; set; } +#nullable restore +#else + public Json ProbabilityS { get; set; } +#endif + /// The trials property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Trials { get; set; } +#nullable restore +#else + public Json Trials { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Binom_InvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Binom_InvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Binom_InvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alpha", n => { Alpha = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probabilityS", n => { ProbabilityS = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "trials", n => { Trials = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alpha", Alpha); + writer.WriteObjectValue("probabilityS", ProbabilityS); + writer.WriteObjectValue("trials", Trials); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Inv/Binom_InvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Inv/Binom_InvRequestBuilder.cs new file mode 100644 index 0000000000..12ff0d72b3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Binom_Inv/Binom_InvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Binom_Inv +{ + /// + /// Provides operations to call the binom_Inv method. + /// + public class Binom_InvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action binom_Inv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action binom_Inv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Binom_InvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Binom_InvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/binom_Inv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Binom_InvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/binom_Inv", rawUrl) + { + } + /// + /// Invoke action binom_Inv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Binom_InvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Binom_InvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitand/BitandPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitand/BitandPostRequestBody.cs new file mode 100644 index 0000000000..4fd7de0623 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitand/BitandPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitand +{ + #pragma warning disable CS1591 + public class BitandPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number1 { get; set; } +#nullable restore +#else + public Json Number1 { get; set; } +#endif + /// The number2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number2 { get; set; } +#nullable restore +#else + public Json Number2 { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BitandPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BitandPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BitandPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number1", n => { Number1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number2", n => { Number2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number1", Number1); + writer.WriteObjectValue("number2", Number2); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitand/BitandRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitand/BitandRequestBuilder.cs new file mode 100644 index 0000000000..988b8765ee --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitand/BitandRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitand +{ + /// + /// Provides operations to call the bitand method. + /// + public class BitandRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action bitand + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action bitand"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BitandPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BitandRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitand", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BitandRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitand", rawUrl) + { + } + /// + /// Invoke action bitand + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BitandPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BitandPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitlshift/BitlshiftPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitlshift/BitlshiftPostRequestBody.cs new file mode 100644 index 0000000000..5c0d055b34 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitlshift/BitlshiftPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitlshift +{ + #pragma warning disable CS1591 + public class BitlshiftPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The shiftAmount property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ShiftAmount { get; set; } +#nullable restore +#else + public Json ShiftAmount { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BitlshiftPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BitlshiftPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BitlshiftPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "shiftAmount", n => { ShiftAmount = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("shiftAmount", ShiftAmount); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitlshift/BitlshiftRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitlshift/BitlshiftRequestBuilder.cs new file mode 100644 index 0000000000..8ccac92734 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitlshift/BitlshiftRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitlshift +{ + /// + /// Provides operations to call the bitlshift method. + /// + public class BitlshiftRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action bitlshift + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action bitlshift"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BitlshiftPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BitlshiftRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitlshift", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BitlshiftRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitlshift", rawUrl) + { + } + /// + /// Invoke action bitlshift + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BitlshiftPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BitlshiftPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitor/BitorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitor/BitorPostRequestBody.cs new file mode 100644 index 0000000000..1a9e24063e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitor/BitorPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitor +{ + #pragma warning disable CS1591 + public class BitorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number1 { get; set; } +#nullable restore +#else + public Json Number1 { get; set; } +#endif + /// The number2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number2 { get; set; } +#nullable restore +#else + public Json Number2 { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BitorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BitorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BitorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number1", n => { Number1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number2", n => { Number2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number1", Number1); + writer.WriteObjectValue("number2", Number2); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitor/BitorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitor/BitorRequestBuilder.cs new file mode 100644 index 0000000000..eebc227611 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitor/BitorRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitor +{ + /// + /// Provides operations to call the bitor method. + /// + public class BitorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action bitor + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action bitor"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BitorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BitorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitor", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BitorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitor", rawUrl) + { + } + /// + /// Invoke action bitor + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BitorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BitorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitrshift/BitrshiftPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitrshift/BitrshiftPostRequestBody.cs new file mode 100644 index 0000000000..c4210cce66 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitrshift/BitrshiftPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitrshift +{ + #pragma warning disable CS1591 + public class BitrshiftPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The shiftAmount property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ShiftAmount { get; set; } +#nullable restore +#else + public Json ShiftAmount { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BitrshiftPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BitrshiftPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BitrshiftPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "shiftAmount", n => { ShiftAmount = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("shiftAmount", ShiftAmount); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitrshift/BitrshiftRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitrshift/BitrshiftRequestBuilder.cs new file mode 100644 index 0000000000..8007d803d5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitrshift/BitrshiftRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitrshift +{ + /// + /// Provides operations to call the bitrshift method. + /// + public class BitrshiftRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action bitrshift + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action bitrshift"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BitrshiftPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BitrshiftRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitrshift", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BitrshiftRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitrshift", rawUrl) + { + } + /// + /// Invoke action bitrshift + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BitrshiftPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BitrshiftPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitxor/BitxorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitxor/BitxorPostRequestBody.cs new file mode 100644 index 0000000000..9acde2886a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitxor/BitxorPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitxor +{ + #pragma warning disable CS1591 + public class BitxorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number1 { get; set; } +#nullable restore +#else + public Json Number1 { get; set; } +#endif + /// The number2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number2 { get; set; } +#nullable restore +#else + public Json Number2 { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public BitxorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static BitxorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BitxorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number1", n => { Number1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number2", n => { Number2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number1", Number1); + writer.WriteObjectValue("number2", Number2); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitxor/BitxorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitxor/BitxorRequestBuilder.cs new file mode 100644 index 0000000000..7d91f2c586 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Bitxor/BitxorRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitxor +{ + /// + /// Provides operations to call the bitxor method. + /// + public class BitxorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action bitxor + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action bitxor"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(BitxorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BitxorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitxor", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BitxorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/bitxor", rawUrl) + { + } + /// + /// Invoke action bitxor + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BitxorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BitxorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathPostRequestBody.cs new file mode 100644 index 0000000000..f841f0e15f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ceiling_Math +{ + #pragma warning disable CS1591 + public class Ceiling_MathPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The mode property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Mode { get; set; } +#nullable restore +#else + public Json Mode { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The significance property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Significance { get; set; } +#nullable restore +#else + public Json Significance { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Ceiling_MathPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Ceiling_MathPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Ceiling_MathPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "mode", n => { Mode = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "significance", n => { Significance = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mode", Mode); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("significance", Significance); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathRequestBuilder.cs new file mode 100644 index 0000000000..003a9b5acf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Math/Ceiling_MathRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ceiling_Math +{ + /// + /// Provides operations to call the ceiling_Math method. + /// + public class Ceiling_MathRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action ceiling_Math + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action ceiling_Math"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Ceiling_MathPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Ceiling_MathRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ceiling_Math", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Ceiling_MathRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ceiling_Math", rawUrl) + { + } + /// + /// Invoke action ceiling_Math + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Ceiling_MathPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Ceiling_MathPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PrecisePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PrecisePostRequestBody.cs new file mode 100644 index 0000000000..d8273861ee --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PrecisePostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ceiling_Precise +{ + #pragma warning disable CS1591 + public class Ceiling_PrecisePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The significance property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Significance { get; set; } +#nullable restore +#else + public Json Significance { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Ceiling_PrecisePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Ceiling_PrecisePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Ceiling_PrecisePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "significance", n => { Significance = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("significance", Significance); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PreciseRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PreciseRequestBuilder.cs new file mode 100644 index 0000000000..ca1ecb43d1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ceiling_Precise/Ceiling_PreciseRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ceiling_Precise +{ + /// + /// Provides operations to call the ceiling_Precise method. + /// + public class Ceiling_PreciseRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action ceiling_Precise + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action ceiling_Precise"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Ceiling_PrecisePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Ceiling_PreciseRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ceiling_Precise", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Ceiling_PreciseRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ceiling_Precise", rawUrl) + { + } + /// + /// Invoke action ceiling_Precise + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Ceiling_PrecisePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Ceiling_PrecisePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CharNamespace/CharPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CharNamespace/CharPostRequestBody.cs new file mode 100644 index 0000000000..cfdda4d75c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CharNamespace/CharPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CharNamespace +{ + #pragma warning disable CS1591 + public class CharPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CharPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CharPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CharPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CharNamespace/CharRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CharNamespace/CharRequestBuilder.cs new file mode 100644 index 0000000000..2062ee65d7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CharNamespace/CharRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CharNamespace +{ + /// + /// Provides operations to call the char method. + /// + public class CharRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action char + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action char"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CharPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CharRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/char", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CharRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/char", rawUrl) + { + } + /// + /// Invoke action char + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CharPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CharPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistPostRequestBody.cs new file mode 100644 index 0000000000..082301f7da --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Dist +{ + #pragma warning disable CS1591 + public class ChiSq_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The degFreedom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom { get; set; } +#nullable restore +#else + public Json DegFreedom { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ChiSq_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ChiSq_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChiSq_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "degFreedom", n => { DegFreedom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("degFreedom", DegFreedom); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistRequestBuilder.cs new file mode 100644 index 0000000000..9edb7399ad --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist/ChiSq_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Dist +{ + /// + /// Provides operations to call the chiSq_Dist method. + /// + public class ChiSq_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action chiSq_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action chiSq_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ChiSq_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ChiSq_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/chiSq_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ChiSq_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/chiSq_Dist", rawUrl) + { + } + /// + /// Invoke action chiSq_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ChiSq_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ChiSq_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTPostRequestBody.cs new file mode 100644 index 0000000000..e0e0dac305 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Dist_RT +{ + #pragma warning disable CS1591 + public class ChiSq_Dist_RTPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom { get; set; } +#nullable restore +#else + public Json DegFreedom { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ChiSq_Dist_RTPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ChiSq_Dist_RTPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChiSq_Dist_RTPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom", n => { DegFreedom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom", DegFreedom); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTRequestBuilder.cs new file mode 100644 index 0000000000..0ae2ff26dc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Dist_RT/ChiSq_Dist_RTRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Dist_RT +{ + /// + /// Provides operations to call the chiSq_Dist_RT method. + /// + public class ChiSq_Dist_RTRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action chiSq_Dist_RT + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action chiSq_Dist_RT"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ChiSq_Dist_RTPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ChiSq_Dist_RTRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/chiSq_Dist_RT", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ChiSq_Dist_RTRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/chiSq_Dist_RT", rawUrl) + { + } + /// + /// Invoke action chiSq_Dist_RT + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ChiSq_Dist_RTPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ChiSq_Dist_RTPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvPostRequestBody.cs new file mode 100644 index 0000000000..1f14c81fd4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Inv +{ + #pragma warning disable CS1591 + public class ChiSq_InvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom { get; set; } +#nullable restore +#else + public Json DegFreedom { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ChiSq_InvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ChiSq_InvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChiSq_InvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom", n => { DegFreedom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom", DegFreedom); + writer.WriteObjectValue("probability", Probability); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvRequestBuilder.cs new file mode 100644 index 0000000000..71cdbf4a6d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv/ChiSq_InvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Inv +{ + /// + /// Provides operations to call the chiSq_Inv method. + /// + public class ChiSq_InvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action chiSq_Inv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action chiSq_Inv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ChiSq_InvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ChiSq_InvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/chiSq_Inv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ChiSq_InvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/chiSq_Inv", rawUrl) + { + } + /// + /// Invoke action chiSq_Inv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ChiSq_InvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ChiSq_InvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTPostRequestBody.cs new file mode 100644 index 0000000000..7f087eadb4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Inv_RT +{ + #pragma warning disable CS1591 + public class ChiSq_Inv_RTPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom { get; set; } +#nullable restore +#else + public Json DegFreedom { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ChiSq_Inv_RTPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ChiSq_Inv_RTPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChiSq_Inv_RTPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom", n => { DegFreedom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom", DegFreedom); + writer.WriteObjectValue("probability", Probability); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTRequestBuilder.cs new file mode 100644 index 0000000000..54f69baad6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ChiSq_Inv_RT/ChiSq_Inv_RTRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Inv_RT +{ + /// + /// Provides operations to call the chiSq_Inv_RT method. + /// + public class ChiSq_Inv_RTRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action chiSq_Inv_RT + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action chiSq_Inv_RT"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ChiSq_Inv_RTPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ChiSq_Inv_RTRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/chiSq_Inv_RT", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ChiSq_Inv_RTRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/chiSq_Inv_RT", rawUrl) + { + } + /// + /// Invoke action chiSq_Inv_RT + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ChiSq_Inv_RTPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ChiSq_Inv_RTPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Choose/ChoosePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Choose/ChoosePostRequestBody.cs new file mode 100644 index 0000000000..0f0f935be9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Choose/ChoosePostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Choose +{ + #pragma warning disable CS1591 + public class ChoosePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The indexNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? IndexNum { get; set; } +#nullable restore +#else + public Json IndexNum { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ChoosePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ChoosePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChoosePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "indexNum", n => { IndexNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("indexNum", IndexNum); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Choose/ChooseRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Choose/ChooseRequestBuilder.cs new file mode 100644 index 0000000000..d53248d931 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Choose/ChooseRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Choose +{ + /// + /// Provides operations to call the choose method. + /// + public class ChooseRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action choose + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action choose"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ChoosePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ChooseRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/choose", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ChooseRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/choose", rawUrl) + { + } + /// + /// Invoke action choose + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ChoosePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ChoosePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Clean/CleanPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Clean/CleanPostRequestBody.cs new file mode 100644 index 0000000000..499748348d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Clean/CleanPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Clean +{ + #pragma warning disable CS1591 + public class CleanPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CleanPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CleanPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CleanPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Clean/CleanRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Clean/CleanRequestBuilder.cs new file mode 100644 index 0000000000..9191ec2ad7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Clean/CleanRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Clean +{ + /// + /// Provides operations to call the clean method. + /// + public class CleanRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action clean + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action clean"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CleanPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CleanRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/clean", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CleanRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/clean", rawUrl) + { + } + /// + /// Invoke action clean + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CleanPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CleanPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Code/CodePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Code/CodePostRequestBody.cs new file mode 100644 index 0000000000..551c78e9c8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Code/CodePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Code +{ + #pragma warning disable CS1591 + public class CodePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CodePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CodePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CodePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Code/CodeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Code/CodeRequestBuilder.cs new file mode 100644 index 0000000000..9f29908c5f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Code/CodeRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Code +{ + /// + /// Provides operations to call the code method. + /// + public class CodeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action code + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action code"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CodePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CodeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/code", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CodeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/code", rawUrl) + { + } + /// + /// Invoke action code + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CodePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CodePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Columns/ColumnsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Columns/ColumnsPostRequestBody.cs new file mode 100644 index 0000000000..0cb5de3687 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Columns/ColumnsPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Columns +{ + #pragma warning disable CS1591 + public class ColumnsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ColumnsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ColumnsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ColumnsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Columns/ColumnsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Columns/ColumnsRequestBuilder.cs new file mode 100644 index 0000000000..002ede8016 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Columns/ColumnsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Columns +{ + /// + /// Provides operations to call the columns method. + /// + public class ColumnsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action columns + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action columns"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ColumnsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/columns", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/columns", rawUrl) + { + } + /// + /// Invoke action columns + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ColumnsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ColumnsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combin/CombinPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combin/CombinPostRequestBody.cs new file mode 100644 index 0000000000..05f2ba70ad --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combin/CombinPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Combin +{ + #pragma warning disable CS1591 + public class CombinPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The numberChosen property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberChosen { get; set; } +#nullable restore +#else + public Json NumberChosen { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CombinPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CombinPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CombinPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberChosen", n => { NumberChosen = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("numberChosen", NumberChosen); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combin/CombinRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combin/CombinRequestBuilder.cs new file mode 100644 index 0000000000..9450799504 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combin/CombinRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Combin +{ + /// + /// Provides operations to call the combin method. + /// + public class CombinRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action combin + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action combin"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CombinPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CombinRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/combin", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CombinRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/combin", rawUrl) + { + } + /// + /// Invoke action combin + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CombinPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CombinPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combina/CombinaPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combina/CombinaPostRequestBody.cs new file mode 100644 index 0000000000..0bcc7eca30 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combina/CombinaPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Combina +{ + #pragma warning disable CS1591 + public class CombinaPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The numberChosen property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberChosen { get; set; } +#nullable restore +#else + public Json NumberChosen { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CombinaPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CombinaPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CombinaPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberChosen", n => { NumberChosen = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("numberChosen", NumberChosen); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combina/CombinaRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combina/CombinaRequestBuilder.cs new file mode 100644 index 0000000000..6a77110bab --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Combina/CombinaRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Combina +{ + /// + /// Provides operations to call the combina method. + /// + public class CombinaRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action combina + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action combina"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CombinaPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CombinaRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/combina", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CombinaRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/combina", rawUrl) + { + } + /// + /// Invoke action combina + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CombinaPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CombinaPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Complex/ComplexPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Complex/ComplexPostRequestBody.cs new file mode 100644 index 0000000000..de95195d49 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Complex/ComplexPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Complex +{ + #pragma warning disable CS1591 + public class ComplexPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The iNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? INum { get; set; } +#nullable restore +#else + public Json INum { get; set; } +#endif + /// The realNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? RealNum { get; set; } +#nullable restore +#else + public Json RealNum { get; set; } +#endif + /// The suffix property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Suffix { get; set; } +#nullable restore +#else + public Json Suffix { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ComplexPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ComplexPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ComplexPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "iNum", n => { INum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "realNum", n => { RealNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "suffix", n => { Suffix = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("iNum", INum); + writer.WriteObjectValue("realNum", RealNum); + writer.WriteObjectValue("suffix", Suffix); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Complex/ComplexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Complex/ComplexRequestBuilder.cs new file mode 100644 index 0000000000..edd0c985a1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Complex/ComplexRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Complex +{ + /// + /// Provides operations to call the complex method. + /// + public class ComplexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action complex + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action complex"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ComplexPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ComplexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/complex", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ComplexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/complex", rawUrl) + { + } + /// + /// Invoke action complex + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ComplexPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ComplexPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Concatenate/ConcatenatePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Concatenate/ConcatenatePostRequestBody.cs new file mode 100644 index 0000000000..d3097c4488 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Concatenate/ConcatenatePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Concatenate +{ + #pragma warning disable CS1591 + public class ConcatenatePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ConcatenatePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ConcatenatePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ConcatenatePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Concatenate/ConcatenateRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Concatenate/ConcatenateRequestBuilder.cs new file mode 100644 index 0000000000..ef88e8a378 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Concatenate/ConcatenateRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Concatenate +{ + /// + /// Provides operations to call the concatenate method. + /// + public class ConcatenateRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action concatenate + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action concatenate"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ConcatenatePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ConcatenateRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/concatenate", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ConcatenateRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/concatenate", rawUrl) + { + } + /// + /// Invoke action concatenate + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ConcatenatePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ConcatenatePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_Norm/Confidence_NormPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_Norm/Confidence_NormPostRequestBody.cs new file mode 100644 index 0000000000..89fcf9b525 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_Norm/Confidence_NormPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Confidence_Norm +{ + #pragma warning disable CS1591 + public class Confidence_NormPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alpha property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Alpha { get; set; } +#nullable restore +#else + public Json Alpha { get; set; } +#endif + /// The size property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Size { get; set; } +#nullable restore +#else + public Json Size { get; set; } +#endif + /// The standardDev property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StandardDev { get; set; } +#nullable restore +#else + public Json StandardDev { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Confidence_NormPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Confidence_NormPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Confidence_NormPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alpha", n => { Alpha = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "size", n => { Size = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "standardDev", n => { StandardDev = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alpha", Alpha); + writer.WriteObjectValue("size", Size); + writer.WriteObjectValue("standardDev", StandardDev); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_Norm/Confidence_NormRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_Norm/Confidence_NormRequestBuilder.cs new file mode 100644 index 0000000000..9963ecf1c4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_Norm/Confidence_NormRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Confidence_Norm +{ + /// + /// Provides operations to call the confidence_Norm method. + /// + public class Confidence_NormRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action confidence_Norm + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action confidence_Norm"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Confidence_NormPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Confidence_NormRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/confidence_Norm", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Confidence_NormRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/confidence_Norm", rawUrl) + { + } + /// + /// Invoke action confidence_Norm + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Confidence_NormPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Confidence_NormPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_T/Confidence_TPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_T/Confidence_TPostRequestBody.cs new file mode 100644 index 0000000000..e4f535d7d4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_T/Confidence_TPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Confidence_T +{ + #pragma warning disable CS1591 + public class Confidence_TPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alpha property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Alpha { get; set; } +#nullable restore +#else + public Json Alpha { get; set; } +#endif + /// The size property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Size { get; set; } +#nullable restore +#else + public Json Size { get; set; } +#endif + /// The standardDev property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StandardDev { get; set; } +#nullable restore +#else + public Json StandardDev { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Confidence_TPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Confidence_TPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Confidence_TPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alpha", n => { Alpha = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "size", n => { Size = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "standardDev", n => { StandardDev = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alpha", Alpha); + writer.WriteObjectValue("size", Size); + writer.WriteObjectValue("standardDev", StandardDev); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_T/Confidence_TRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_T/Confidence_TRequestBuilder.cs new file mode 100644 index 0000000000..343a559c88 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Confidence_T/Confidence_TRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Confidence_T +{ + /// + /// Provides operations to call the confidence_T method. + /// + public class Confidence_TRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action confidence_T + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action confidence_T"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Confidence_TPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Confidence_TRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/confidence_T", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Confidence_TRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/confidence_T", rawUrl) + { + } + /// + /// Invoke action confidence_T + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Confidence_TPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Confidence_TPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ConvertNamespace/ConvertPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ConvertNamespace/ConvertPostRequestBody.cs new file mode 100644 index 0000000000..fb938e9f32 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ConvertNamespace/ConvertPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ConvertNamespace +{ + #pragma warning disable CS1591 + public class ConvertPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fromUnit property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FromUnit { get; set; } +#nullable restore +#else + public Json FromUnit { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The toUnit property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ToUnit { get; set; } +#nullable restore +#else + public Json ToUnit { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ConvertPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ConvertPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ConvertPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fromUnit", n => { FromUnit = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "toUnit", n => { ToUnit = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fromUnit", FromUnit); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("toUnit", ToUnit); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ConvertNamespace/ConvertRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ConvertNamespace/ConvertRequestBuilder.cs new file mode 100644 index 0000000000..ef75eb53fc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ConvertNamespace/ConvertRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ConvertNamespace +{ + /// + /// Provides operations to call the convert method. + /// + public class ConvertRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action convert + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action convert"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ConvertPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ConvertRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/convert", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ConvertRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/convert", rawUrl) + { + } + /// + /// Invoke action convert + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ConvertPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ConvertPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cos/CosPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cos/CosPostRequestBody.cs new file mode 100644 index 0000000000..c2db04e9ac --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cos/CosPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Cos +{ + #pragma warning disable CS1591 + public class CosPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CosPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CosPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CosPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cos/CosRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cos/CosRequestBuilder.cs new file mode 100644 index 0000000000..bdd6efdd29 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cos/CosRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Cos +{ + /// + /// Provides operations to call the cos method. + /// + public class CosRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action cos + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action cos"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CosPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CosRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cos", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CosRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cos", rawUrl) + { + } + /// + /// Invoke action cos + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CosPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CosPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cosh/CoshPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cosh/CoshPostRequestBody.cs new file mode 100644 index 0000000000..944b8cf7eb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cosh/CoshPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Cosh +{ + #pragma warning disable CS1591 + public class CoshPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CoshPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CoshPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CoshPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cosh/CoshRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cosh/CoshRequestBuilder.cs new file mode 100644 index 0000000000..63b5c96751 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cosh/CoshRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Cosh +{ + /// + /// Provides operations to call the cosh method. + /// + public class CoshRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action cosh + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action cosh"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CoshPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CoshRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cosh", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CoshRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cosh", rawUrl) + { + } + /// + /// Invoke action cosh + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CoshPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CoshPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cot/CotPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cot/CotPostRequestBody.cs new file mode 100644 index 0000000000..c36a39a3b7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cot/CotPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Cot +{ + #pragma warning disable CS1591 + public class CotPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CotPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CotPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CotPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cot/CotRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cot/CotRequestBuilder.cs new file mode 100644 index 0000000000..b39f162ded --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Cot/CotRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Cot +{ + /// + /// Provides operations to call the cot method. + /// + public class CotRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action cot + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action cot"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CotPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CotRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cot", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CotRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cot", rawUrl) + { + } + /// + /// Invoke action cot + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CotPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CotPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Coth/CothPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Coth/CothPostRequestBody.cs new file mode 100644 index 0000000000..37a3afa236 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Coth/CothPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Coth +{ + #pragma warning disable CS1591 + public class CothPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CothPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CothPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CothPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Coth/CothRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Coth/CothRequestBuilder.cs new file mode 100644 index 0000000000..dc667cfc31 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Coth/CothRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Coth +{ + /// + /// Provides operations to call the coth method. + /// + public class CothRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action coth + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action coth"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CothPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CothRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coth", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CothRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coth", rawUrl) + { + } + /// + /// Invoke action coth + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CothPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CothPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Count/CountPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Count/CountPostRequestBody.cs new file mode 100644 index 0000000000..1b7c693a7b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Count/CountPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Count +{ + #pragma warning disable CS1591 + public class CountPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CountPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..edd9bc9a16 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Count/CountRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action count + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CountPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/count", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/count", rawUrl) + { + } + /// + /// Invoke action count + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CountPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CountPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountA/CountAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountA/CountAPostRequestBody.cs new file mode 100644 index 0000000000..52929e00cf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountA/CountAPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountA +{ + #pragma warning disable CS1591 + public class CountAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CountAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountA/CountARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountA/CountARequestBuilder.cs new file mode 100644 index 0000000000..b9b21c59f2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountA/CountARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountA +{ + /// + /// Provides operations to call the countA method. + /// + public class CountARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action countA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action countA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CountAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/countA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/countA", rawUrl) + { + } + /// + /// Invoke action countA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CountAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CountAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountBlank/CountBlankPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountBlank/CountBlankPostRequestBody.cs new file mode 100644 index 0000000000..b3495624c4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountBlank/CountBlankPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountBlank +{ + #pragma warning disable CS1591 + public class CountBlankPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The range property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Range { get; set; } +#nullable restore +#else + public Json Range { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CountBlankPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountBlankPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountBlankPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "range", n => { Range = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("range", Range); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountBlank/CountBlankRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountBlank/CountBlankRequestBuilder.cs new file mode 100644 index 0000000000..1fdf781e15 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountBlank/CountBlankRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountBlank +{ + /// + /// Provides operations to call the countBlank method. + /// + public class CountBlankRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action countBlank + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action countBlank"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CountBlankPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountBlankRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/countBlank", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountBlankRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/countBlank", rawUrl) + { + } + /// + /// Invoke action countBlank + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CountBlankPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CountBlankPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIf/CountIfPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIf/CountIfPostRequestBody.cs new file mode 100644 index 0000000000..d755b38786 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIf/CountIfPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountIf +{ + #pragma warning disable CS1591 + public class CountIfPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The range property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Range { get; set; } +#nullable restore +#else + public Json Range { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CountIfPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountIfPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountIfPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "range", n => { Range = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("range", Range); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIf/CountIfRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIf/CountIfRequestBuilder.cs new file mode 100644 index 0000000000..d372eefa5c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIf/CountIfRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountIf +{ + /// + /// Provides operations to call the countIf method. + /// + public class CountIfRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action countIf + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action countIf"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CountIfPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountIfRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/countIf", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountIfRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/countIf", rawUrl) + { + } + /// + /// Invoke action countIf + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CountIfPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CountIfPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIfs/CountIfsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIfs/CountIfsPostRequestBody.cs new file mode 100644 index 0000000000..cfa600ec90 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIfs/CountIfsPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountIfs +{ + #pragma warning disable CS1591 + public class CountIfsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CountIfsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountIfsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountIfsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIfs/CountIfsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIfs/CountIfsRequestBuilder.cs new file mode 100644 index 0000000000..69612c0131 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CountIfs/CountIfsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountIfs +{ + /// + /// Provides operations to call the countIfs method. + /// + public class CountIfsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action countIfs + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action countIfs"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CountIfsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountIfsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/countIfs", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountIfsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/countIfs", rawUrl) + { + } + /// + /// Invoke action countIfs + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CountIfsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CountIfsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDayBs/CoupDayBsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDayBs/CoupDayBsPostRequestBody.cs new file mode 100644 index 0000000000..78fc4465c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDayBs/CoupDayBsPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupDayBs +{ + #pragma warning disable CS1591 + public class CoupDayBsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CoupDayBsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CoupDayBsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CoupDayBsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDayBs/CoupDayBsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDayBs/CoupDayBsRequestBuilder.cs new file mode 100644 index 0000000000..1d00f6a4a7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDayBs/CoupDayBsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupDayBs +{ + /// + /// Provides operations to call the coupDayBs method. + /// + public class CoupDayBsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action coupDayBs + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action coupDayBs"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CoupDayBsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CoupDayBsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupDayBs", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CoupDayBsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupDayBs", rawUrl) + { + } + /// + /// Invoke action coupDayBs + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CoupDayBsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CoupDayBsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDays/CoupDaysPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDays/CoupDaysPostRequestBody.cs new file mode 100644 index 0000000000..8ed8d6fcc1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDays/CoupDaysPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupDays +{ + #pragma warning disable CS1591 + public class CoupDaysPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CoupDaysPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CoupDaysPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CoupDaysPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDays/CoupDaysRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDays/CoupDaysRequestBuilder.cs new file mode 100644 index 0000000000..4410d5ae08 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDays/CoupDaysRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupDays +{ + /// + /// Provides operations to call the coupDays method. + /// + public class CoupDaysRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action coupDays + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action coupDays"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CoupDaysPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CoupDaysRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupDays", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CoupDaysRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupDays", rawUrl) + { + } + /// + /// Invoke action coupDays + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CoupDaysPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CoupDaysPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcPostRequestBody.cs new file mode 100644 index 0000000000..0195b0115f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupDaysNc +{ + #pragma warning disable CS1591 + public class CoupDaysNcPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CoupDaysNcPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CoupDaysNcPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CoupDaysNcPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcRequestBuilder.cs new file mode 100644 index 0000000000..6e1908fbd1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupDaysNc/CoupDaysNcRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupDaysNc +{ + /// + /// Provides operations to call the coupDaysNc method. + /// + public class CoupDaysNcRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action coupDaysNc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action coupDaysNc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CoupDaysNcPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CoupDaysNcRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupDaysNc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CoupDaysNcRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupDaysNc", rawUrl) + { + } + /// + /// Invoke action coupDaysNc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CoupDaysNcPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CoupDaysNcPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNcd/CoupNcdPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNcd/CoupNcdPostRequestBody.cs new file mode 100644 index 0000000000..3d7917fb1f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNcd/CoupNcdPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupNcd +{ + #pragma warning disable CS1591 + public class CoupNcdPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CoupNcdPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CoupNcdPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CoupNcdPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNcd/CoupNcdRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNcd/CoupNcdRequestBuilder.cs new file mode 100644 index 0000000000..6d4acac091 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNcd/CoupNcdRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupNcd +{ + /// + /// Provides operations to call the coupNcd method. + /// + public class CoupNcdRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action coupNcd + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action coupNcd"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CoupNcdPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CoupNcdRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupNcd", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CoupNcdRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupNcd", rawUrl) + { + } + /// + /// Invoke action coupNcd + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CoupNcdPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CoupNcdPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNum/CoupNumPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNum/CoupNumPostRequestBody.cs new file mode 100644 index 0000000000..81c6af2992 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNum/CoupNumPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupNum +{ + #pragma warning disable CS1591 + public class CoupNumPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CoupNumPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CoupNumPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CoupNumPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNum/CoupNumRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNum/CoupNumRequestBuilder.cs new file mode 100644 index 0000000000..112ab5cd17 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupNum/CoupNumRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupNum +{ + /// + /// Provides operations to call the coupNum method. + /// + public class CoupNumRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action coupNum + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action coupNum"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CoupNumPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CoupNumRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupNum", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CoupNumRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupNum", rawUrl) + { + } + /// + /// Invoke action coupNum + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CoupNumPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CoupNumPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupPcd/CoupPcdPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupPcd/CoupPcdPostRequestBody.cs new file mode 100644 index 0000000000..e18899a4bd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupPcd/CoupPcdPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupPcd +{ + #pragma warning disable CS1591 + public class CoupPcdPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CoupPcdPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CoupPcdPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CoupPcdPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupPcd/CoupPcdRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupPcd/CoupPcdRequestBuilder.cs new file mode 100644 index 0000000000..f6eace616a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CoupPcd/CoupPcdRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupPcd +{ + /// + /// Provides operations to call the coupPcd method. + /// + public class CoupPcdRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action coupPcd + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action coupPcd"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CoupPcdPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CoupPcdRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupPcd", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CoupPcdRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/coupPcd", rawUrl) + { + } + /// + /// Invoke action coupPcd + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CoupPcdPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CoupPcdPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csc/CscPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csc/CscPostRequestBody.cs new file mode 100644 index 0000000000..cd6e8b98d6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csc/CscPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Csc +{ + #pragma warning disable CS1591 + public class CscPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CscPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CscPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CscPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csc/CscRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csc/CscRequestBuilder.cs new file mode 100644 index 0000000000..a60cf5b583 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csc/CscRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Csc +{ + /// + /// Provides operations to call the csc method. + /// + public class CscRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action csc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action csc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CscPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CscRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/csc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CscRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/csc", rawUrl) + { + } + /// + /// Invoke action csc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CscPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CscPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csch/CschPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csch/CschPostRequestBody.cs new file mode 100644 index 0000000000..3a5fede7b2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csch/CschPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Csch +{ + #pragma warning disable CS1591 + public class CschPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CschPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CschPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CschPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csch/CschRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csch/CschRequestBuilder.cs new file mode 100644 index 0000000000..9885ac2573 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Csch/CschRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Csch +{ + /// + /// Provides operations to call the csch method. + /// + public class CschRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action csch + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action csch"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CschPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CschRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/csch", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CschRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/csch", rawUrl) + { + } + /// + /// Invoke action csch + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CschPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CschPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumIPmt/CumIPmtPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumIPmt/CumIPmtPostRequestBody.cs new file mode 100644 index 0000000000..d87bd36cd7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumIPmt/CumIPmtPostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CumIPmt +{ + #pragma warning disable CS1591 + public class CumIPmtPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endPeriod property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndPeriod { get; set; } +#nullable restore +#else + public Json EndPeriod { get; set; } +#endif + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The startPeriod property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartPeriod { get; set; } +#nullable restore +#else + public Json StartPeriod { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Type { get; set; } +#nullable restore +#else + public Json Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CumIPmtPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CumIPmtPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CumIPmtPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endPeriod", n => { EndPeriod = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startPeriod", n => { StartPeriod = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endPeriod", EndPeriod); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("startPeriod", StartPeriod); + writer.WriteObjectValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumIPmt/CumIPmtRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumIPmt/CumIPmtRequestBuilder.cs new file mode 100644 index 0000000000..01ce33442b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumIPmt/CumIPmtRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CumIPmt +{ + /// + /// Provides operations to call the cumIPmt method. + /// + public class CumIPmtRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action cumIPmt + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action cumIPmt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CumIPmtPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CumIPmtRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cumIPmt", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CumIPmtRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cumIPmt", rawUrl) + { + } + /// + /// Invoke action cumIPmt + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CumIPmtPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CumIPmtPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumPrinc/CumPrincPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumPrinc/CumPrincPostRequestBody.cs new file mode 100644 index 0000000000..470478e916 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumPrinc/CumPrincPostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CumPrinc +{ + #pragma warning disable CS1591 + public class CumPrincPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endPeriod property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndPeriod { get; set; } +#nullable restore +#else + public Json EndPeriod { get; set; } +#endif + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The startPeriod property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartPeriod { get; set; } +#nullable restore +#else + public Json StartPeriod { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Type { get; set; } +#nullable restore +#else + public Json Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CumPrincPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CumPrincPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CumPrincPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endPeriod", n => { EndPeriod = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startPeriod", n => { StartPeriod = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endPeriod", EndPeriod); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("startPeriod", StartPeriod); + writer.WriteObjectValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumPrinc/CumPrincRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumPrinc/CumPrincRequestBuilder.cs new file mode 100644 index 0000000000..9727da6d40 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/CumPrinc/CumPrincRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CumPrinc +{ + /// + /// Provides operations to call the cumPrinc method. + /// + public class CumPrincRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action cumPrinc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action cumPrinc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CumPrincPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CumPrincRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cumPrinc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CumPrincRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/cumPrinc", rawUrl) + { + } + /// + /// Invoke action cumPrinc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CumPrincPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CumPrincPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DateNamespace/DatePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DateNamespace/DatePostRequestBody.cs new file mode 100644 index 0000000000..520955d655 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DateNamespace/DatePostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DateNamespace +{ + #pragma warning disable CS1591 + public class DatePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The day property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Day { get; set; } +#nullable restore +#else + public Json Day { get; set; } +#endif + /// The month property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Month { get; set; } +#nullable restore +#else + public Json Month { get; set; } +#endif + /// The year property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Year { get; set; } +#nullable restore +#else + public Json Year { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DatePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DatePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DatePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "day", n => { Day = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "month", n => { Month = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "year", n => { Year = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("day", Day); + writer.WriteObjectValue("month", Month); + writer.WriteObjectValue("year", Year); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DateNamespace/DateRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DateNamespace/DateRequestBuilder.cs new file mode 100644 index 0000000000..c0b1cf40e1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DateNamespace/DateRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DateNamespace +{ + /// + /// Provides operations to call the date method. + /// + public class DateRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action date + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action date"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DatePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DateRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/date", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DateRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/date", rawUrl) + { + } + /// + /// Invoke action date + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DatePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DatePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Datevalue/DatevaluePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Datevalue/DatevaluePostRequestBody.cs new file mode 100644 index 0000000000..fe5409947e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Datevalue/DatevaluePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Datevalue +{ + #pragma warning disable CS1591 + public class DatevaluePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The dateText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DateText { get; set; } +#nullable restore +#else + public Json DateText { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DatevaluePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DatevaluePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DatevaluePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "dateText", n => { DateText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("dateText", DateText); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Datevalue/DatevalueRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Datevalue/DatevalueRequestBuilder.cs new file mode 100644 index 0000000000..29783a7e7f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Datevalue/DatevalueRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Datevalue +{ + /// + /// Provides operations to call the datevalue method. + /// + public class DatevalueRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action datevalue + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action datevalue"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DatevaluePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DatevalueRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/datevalue", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DatevalueRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/datevalue", rawUrl) + { + } + /// + /// Invoke action datevalue + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DatevaluePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DatevaluePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Daverage/DaveragePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Daverage/DaveragePostRequestBody.cs new file mode 100644 index 0000000000..23c3fde63f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Daverage/DaveragePostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Daverage +{ + #pragma warning disable CS1591 + public class DaveragePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DaveragePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DaveragePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DaveragePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Daverage/DaverageRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Daverage/DaverageRequestBuilder.cs new file mode 100644 index 0000000000..3324bf4408 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Daverage/DaverageRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Daverage +{ + /// + /// Provides operations to call the daverage method. + /// + public class DaverageRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action daverage + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action daverage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DaveragePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DaverageRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/daverage", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DaverageRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/daverage", rawUrl) + { + } + /// + /// Invoke action daverage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DaveragePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DaveragePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Day/DayPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Day/DayPostRequestBody.cs new file mode 100644 index 0000000000..dfc0bbe103 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Day/DayPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Day +{ + #pragma warning disable CS1591 + public class DayPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The serialNumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SerialNumber { get; set; } +#nullable restore +#else + public Json SerialNumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DayPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DayPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DayPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "serialNumber", n => { SerialNumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("serialNumber", SerialNumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Day/DayRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Day/DayRequestBuilder.cs new file mode 100644 index 0000000000..ea06c36220 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Day/DayRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Day +{ + /// + /// Provides operations to call the day method. + /// + public class DayRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action day + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action day"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DayPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DayRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/day", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DayRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/day", rawUrl) + { + } + /// + /// Invoke action day + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DayPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DayPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days/DaysPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days/DaysPostRequestBody.cs new file mode 100644 index 0000000000..103ba54d5d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days/DaysPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Days +{ + #pragma warning disable CS1591 + public class DaysPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndDate { get; set; } +#nullable restore +#else + public Json EndDate { get; set; } +#endif + /// The startDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartDate { get; set; } +#nullable restore +#else + public Json StartDate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DaysPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DaysPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DaysPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endDate", n => { EndDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startDate", n => { StartDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endDate", EndDate); + writer.WriteObjectValue("startDate", StartDate); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days/DaysRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days/DaysRequestBuilder.cs new file mode 100644 index 0000000000..fc94ef1ceb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days/DaysRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Days +{ + /// + /// Provides operations to call the days method. + /// + public class DaysRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action days + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action days"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DaysPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DaysRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/days", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DaysRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/days", rawUrl) + { + } + /// + /// Invoke action days + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DaysPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DaysPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days360/Days360PostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days360/Days360PostRequestBody.cs new file mode 100644 index 0000000000..c680d82d1e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days360/Days360PostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Days360 +{ + #pragma warning disable CS1591 + public class Days360PostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndDate { get; set; } +#nullable restore +#else + public Json EndDate { get; set; } +#endif + /// The method property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Method { get; set; } +#nullable restore +#else + public Json Method { get; set; } +#endif + /// The startDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartDate { get; set; } +#nullable restore +#else + public Json StartDate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Days360PostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Days360PostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Days360PostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endDate", n => { EndDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "method", n => { Method = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startDate", n => { StartDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endDate", EndDate); + writer.WriteObjectValue("method", Method); + writer.WriteObjectValue("startDate", StartDate); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days360/Days360RequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days360/Days360RequestBuilder.cs new file mode 100644 index 0000000000..5d73ddfa75 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Days360/Days360RequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Days360 +{ + /// + /// Provides operations to call the days360 method. + /// + public class Days360RequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action days360 + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action days360"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Days360PostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Days360RequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/days360", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Days360RequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/days360", rawUrl) + { + } + /// + /// Invoke action days360 + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Days360PostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Days360PostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Db/DbPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Db/DbPostRequestBody.cs new file mode 100644 index 0000000000..a13870205c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Db/DbPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Db +{ + #pragma warning disable CS1591 + public class DbPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cost property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cost { get; set; } +#nullable restore +#else + public Json Cost { get; set; } +#endif + /// The life property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Life { get; set; } +#nullable restore +#else + public Json Life { get; set; } +#endif + /// The month property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Month { get; set; } +#nullable restore +#else + public Json Month { get; set; } +#endif + /// The period property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Period { get; set; } +#nullable restore +#else + public Json Period { get; set; } +#endif + /// The salvage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Salvage { get; set; } +#nullable restore +#else + public Json Salvage { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DbPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DbPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DbPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cost", n => { Cost = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "life", n => { Life = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "month", n => { Month = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "period", n => { Period = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "salvage", n => { Salvage = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cost", Cost); + writer.WriteObjectValue("life", Life); + writer.WriteObjectValue("month", Month); + writer.WriteObjectValue("period", Period); + writer.WriteObjectValue("salvage", Salvage); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Db/DbRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Db/DbRequestBuilder.cs new file mode 100644 index 0000000000..760a580940 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Db/DbRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Db +{ + /// + /// Provides operations to call the db method. + /// + public class DbRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action db + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action db"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DbPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DbRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/db", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DbRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/db", rawUrl) + { + } + /// + /// Invoke action db + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DbPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DbPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dbcs/DbcsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dbcs/DbcsPostRequestBody.cs new file mode 100644 index 0000000000..bf5cefe585 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dbcs/DbcsPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dbcs +{ + #pragma warning disable CS1591 + public class DbcsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DbcsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DbcsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DbcsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dbcs/DbcsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dbcs/DbcsRequestBuilder.cs new file mode 100644 index 0000000000..8f3ccd2e6e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dbcs/DbcsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dbcs +{ + /// + /// Provides operations to call the dbcs method. + /// + public class DbcsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dbcs + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dbcs"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DbcsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DbcsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dbcs", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DbcsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dbcs", rawUrl) + { + } + /// + /// Invoke action dbcs + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DbcsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DbcsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dcount/DcountPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dcount/DcountPostRequestBody.cs new file mode 100644 index 0000000000..568aa00484 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dcount/DcountPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dcount +{ + #pragma warning disable CS1591 + public class DcountPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DcountPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DcountPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DcountPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dcount/DcountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dcount/DcountRequestBuilder.cs new file mode 100644 index 0000000000..125d74151e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dcount/DcountRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dcount +{ + /// + /// Provides operations to call the dcount method. + /// + public class DcountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dcount + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dcount"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DcountPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DcountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dcount", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DcountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dcount", rawUrl) + { + } + /// + /// Invoke action dcount + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DcountPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DcountPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DcountA/DcountAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DcountA/DcountAPostRequestBody.cs new file mode 100644 index 0000000000..bb5e35eebf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DcountA/DcountAPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DcountA +{ + #pragma warning disable CS1591 + public class DcountAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DcountAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DcountAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DcountAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DcountA/DcountARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DcountA/DcountARequestBuilder.cs new file mode 100644 index 0000000000..e11b6ed90e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DcountA/DcountARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DcountA +{ + /// + /// Provides operations to call the dcountA method. + /// + public class DcountARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dcountA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dcountA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DcountAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DcountARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dcountA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DcountARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dcountA", rawUrl) + { + } + /// + /// Invoke action dcountA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DcountAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DcountAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ddb/DdbPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ddb/DdbPostRequestBody.cs new file mode 100644 index 0000000000..8a10b4a8b3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ddb/DdbPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ddb +{ + #pragma warning disable CS1591 + public class DdbPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cost property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cost { get; set; } +#nullable restore +#else + public Json Cost { get; set; } +#endif + /// The factor property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Factor { get; set; } +#nullable restore +#else + public Json Factor { get; set; } +#endif + /// The life property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Life { get; set; } +#nullable restore +#else + public Json Life { get; set; } +#endif + /// The period property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Period { get; set; } +#nullable restore +#else + public Json Period { get; set; } +#endif + /// The salvage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Salvage { get; set; } +#nullable restore +#else + public Json Salvage { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DdbPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DdbPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DdbPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cost", n => { Cost = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "factor", n => { Factor = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "life", n => { Life = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "period", n => { Period = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "salvage", n => { Salvage = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cost", Cost); + writer.WriteObjectValue("factor", Factor); + writer.WriteObjectValue("life", Life); + writer.WriteObjectValue("period", Period); + writer.WriteObjectValue("salvage", Salvage); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ddb/DdbRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ddb/DdbRequestBuilder.cs new file mode 100644 index 0000000000..cceacbe922 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ddb/DdbRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ddb +{ + /// + /// Provides operations to call the ddb method. + /// + public class DdbRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action ddb + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action ddb"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DdbPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DdbRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ddb", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DdbRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ddb", rawUrl) + { + } + /// + /// Invoke action ddb + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DdbPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DdbPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Bin/Dec2BinPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Bin/Dec2BinPostRequestBody.cs new file mode 100644 index 0000000000..2544574361 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Bin/Dec2BinPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dec2Bin +{ + #pragma warning disable CS1591 + public class Dec2BinPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The places property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Places { get; set; } +#nullable restore +#else + public Json Places { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Dec2BinPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Dec2BinPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Dec2BinPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "places", n => { Places = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("places", Places); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Bin/Dec2BinRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Bin/Dec2BinRequestBuilder.cs new file mode 100644 index 0000000000..2585839621 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Bin/Dec2BinRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dec2Bin +{ + /// + /// Provides operations to call the dec2Bin method. + /// + public class Dec2BinRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dec2Bin + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dec2Bin"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Dec2BinPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Dec2BinRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dec2Bin", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Dec2BinRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dec2Bin", rawUrl) + { + } + /// + /// Invoke action dec2Bin + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Dec2BinPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Dec2BinPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Hex/Dec2HexPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Hex/Dec2HexPostRequestBody.cs new file mode 100644 index 0000000000..e3ed8c2fa8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Hex/Dec2HexPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dec2Hex +{ + #pragma warning disable CS1591 + public class Dec2HexPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The places property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Places { get; set; } +#nullable restore +#else + public Json Places { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Dec2HexPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Dec2HexPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Dec2HexPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "places", n => { Places = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("places", Places); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Hex/Dec2HexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Hex/Dec2HexRequestBuilder.cs new file mode 100644 index 0000000000..a1cdef4330 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Hex/Dec2HexRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dec2Hex +{ + /// + /// Provides operations to call the dec2Hex method. + /// + public class Dec2HexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dec2Hex + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dec2Hex"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Dec2HexPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Dec2HexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dec2Hex", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Dec2HexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dec2Hex", rawUrl) + { + } + /// + /// Invoke action dec2Hex + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Dec2HexPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Dec2HexPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Oct/Dec2OctPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Oct/Dec2OctPostRequestBody.cs new file mode 100644 index 0000000000..d78db6535c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Oct/Dec2OctPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dec2Oct +{ + #pragma warning disable CS1591 + public class Dec2OctPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The places property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Places { get; set; } +#nullable restore +#else + public Json Places { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Dec2OctPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Dec2OctPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Dec2OctPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "places", n => { Places = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("places", Places); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Oct/Dec2OctRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Oct/Dec2OctRequestBuilder.cs new file mode 100644 index 0000000000..0876b62cff --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dec2Oct/Dec2OctRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dec2Oct +{ + /// + /// Provides operations to call the dec2Oct method. + /// + public class Dec2OctRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dec2Oct + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dec2Oct"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Dec2OctPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Dec2OctRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dec2Oct", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Dec2OctRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dec2Oct", rawUrl) + { + } + /// + /// Invoke action dec2Oct + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Dec2OctPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Dec2OctPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DecimalNamespace/DecimalPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DecimalNamespace/DecimalPostRequestBody.cs new file mode 100644 index 0000000000..09e3e1885d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DecimalNamespace/DecimalPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DecimalNamespace +{ + #pragma warning disable CS1591 + public class DecimalPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The radix property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Radix { get; set; } +#nullable restore +#else + public Json Radix { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DecimalPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DecimalPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DecimalPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "radix", n => { Radix = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("radix", Radix); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DecimalNamespace/DecimalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DecimalNamespace/DecimalRequestBuilder.cs new file mode 100644 index 0000000000..2f4d1784a3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DecimalNamespace/DecimalRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DecimalNamespace +{ + /// + /// Provides operations to call the decimal method. + /// + public class DecimalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action decimal + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action decimal"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DecimalPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DecimalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/decimal", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DecimalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/decimal", rawUrl) + { + } + /// + /// Invoke action decimal + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DecimalPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DecimalPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Degrees/DegreesPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Degrees/DegreesPostRequestBody.cs new file mode 100644 index 0000000000..14df399cb6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Degrees/DegreesPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Degrees +{ + #pragma warning disable CS1591 + public class DegreesPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The angle property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Angle { get; set; } +#nullable restore +#else + public Json Angle { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DegreesPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DegreesPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DegreesPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "angle", n => { Angle = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("angle", Angle); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Degrees/DegreesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Degrees/DegreesRequestBuilder.cs new file mode 100644 index 0000000000..1b6eca0220 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Degrees/DegreesRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Degrees +{ + /// + /// Provides operations to call the degrees method. + /// + public class DegreesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action degrees + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action degrees"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DegreesPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DegreesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/degrees", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DegreesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/degrees", rawUrl) + { + } + /// + /// Invoke action degrees + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DegreesPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DegreesPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Delta/DeltaPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Delta/DeltaPostRequestBody.cs new file mode 100644 index 0000000000..b0bbe9954e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Delta/DeltaPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Delta +{ + #pragma warning disable CS1591 + public class DeltaPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number1 { get; set; } +#nullable restore +#else + public Json Number1 { get; set; } +#endif + /// The number2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number2 { get; set; } +#nullable restore +#else + public Json Number2 { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DeltaPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DeltaPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeltaPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number1", n => { Number1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number2", n => { Number2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number1", Number1); + writer.WriteObjectValue("number2", Number2); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Delta/DeltaRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Delta/DeltaRequestBuilder.cs new file mode 100644 index 0000000000..1ac28da450 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Delta/DeltaRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Delta +{ + /// + /// Provides operations to call the delta method. + /// + public class DeltaRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action delta + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action delta"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DeltaPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DeltaRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/delta", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DeltaRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/delta", rawUrl) + { + } + /// + /// Invoke action delta + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DeltaPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DeltaPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DevSq/DevSqPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DevSq/DevSqPostRequestBody.cs new file mode 100644 index 0000000000..f97abff26d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DevSq/DevSqPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DevSq +{ + #pragma warning disable CS1591 + public class DevSqPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DevSqPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DevSqPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DevSqPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DevSq/DevSqRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DevSq/DevSqRequestBuilder.cs new file mode 100644 index 0000000000..b012ddef50 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DevSq/DevSqRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DevSq +{ + /// + /// Provides operations to call the devSq method. + /// + public class DevSqRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action devSq + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action devSq"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DevSqPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DevSqRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/devSq", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DevSqRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/devSq", rawUrl) + { + } + /// + /// Invoke action devSq + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DevSqPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DevSqPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dget/DgetPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dget/DgetPostRequestBody.cs new file mode 100644 index 0000000000..1d3c0bddc4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dget/DgetPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dget +{ + #pragma warning disable CS1591 + public class DgetPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DgetPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DgetPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DgetPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dget/DgetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dget/DgetRequestBuilder.cs new file mode 100644 index 0000000000..2c694ef930 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dget/DgetRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dget +{ + /// + /// Provides operations to call the dget method. + /// + public class DgetRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dget + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dget"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DgetPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DgetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dget", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DgetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dget", rawUrl) + { + } + /// + /// Invoke action dget + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DgetPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DgetPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Disc/DiscPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Disc/DiscPostRequestBody.cs new file mode 100644 index 0000000000..7808a86ffa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Disc/DiscPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Disc +{ + #pragma warning disable CS1591 + public class DiscPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The pr property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pr { get; set; } +#nullable restore +#else + public Json Pr { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DiscPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DiscPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DiscPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pr", n => { Pr = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("pr", Pr); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Disc/DiscRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Disc/DiscRequestBuilder.cs new file mode 100644 index 0000000000..716733a00a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Disc/DiscRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Disc +{ + /// + /// Provides operations to call the disc method. + /// + public class DiscRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action disc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action disc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DiscPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DiscRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/disc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DiscRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/disc", rawUrl) + { + } + /// + /// Invoke action disc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DiscPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DiscPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmax/DmaxPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmax/DmaxPostRequestBody.cs new file mode 100644 index 0000000000..6f57c0f40b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmax/DmaxPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dmax +{ + #pragma warning disable CS1591 + public class DmaxPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DmaxPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DmaxPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DmaxPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmax/DmaxRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmax/DmaxRequestBuilder.cs new file mode 100644 index 0000000000..dbc5f92331 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmax/DmaxRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dmax +{ + /// + /// Provides operations to call the dmax method. + /// + public class DmaxRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dmax + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dmax"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DmaxPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DmaxRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dmax", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DmaxRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dmax", rawUrl) + { + } + /// + /// Invoke action dmax + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DmaxPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DmaxPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmin/DminPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmin/DminPostRequestBody.cs new file mode 100644 index 0000000000..483c84da31 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmin/DminPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dmin +{ + #pragma warning disable CS1591 + public class DminPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DminPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DminPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DminPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmin/DminRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmin/DminRequestBuilder.cs new file mode 100644 index 0000000000..2df6a82b68 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dmin/DminRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dmin +{ + /// + /// Provides operations to call the dmin method. + /// + public class DminRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dmin + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dmin"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DminPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DminRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dmin", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DminRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dmin", rawUrl) + { + } + /// + /// Invoke action dmin + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DminPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DminPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dollar/DollarPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dollar/DollarPostRequestBody.cs new file mode 100644 index 0000000000..5ab049e821 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dollar/DollarPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dollar +{ + #pragma warning disable CS1591 + public class DollarPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The decimals property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Decimals { get; set; } +#nullable restore +#else + public Json Decimals { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DollarPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DollarPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DollarPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "decimals", n => { Decimals = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("decimals", Decimals); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dollar/DollarRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dollar/DollarRequestBuilder.cs new file mode 100644 index 0000000000..ab3d661038 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dollar/DollarRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dollar +{ + /// + /// Provides operations to call the dollar method. + /// + public class DollarRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dollar + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dollar"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DollarPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DollarRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dollar", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DollarRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dollar", rawUrl) + { + } + /// + /// Invoke action dollar + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DollarPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DollarPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarDe/DollarDePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarDe/DollarDePostRequestBody.cs new file mode 100644 index 0000000000..f1595df09f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarDe/DollarDePostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DollarDe +{ + #pragma warning disable CS1591 + public class DollarDePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fraction property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fraction { get; set; } +#nullable restore +#else + public Json Fraction { get; set; } +#endif + /// The fractionalDollar property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FractionalDollar { get; set; } +#nullable restore +#else + public Json FractionalDollar { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DollarDePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DollarDePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DollarDePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fraction", n => { Fraction = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "fractionalDollar", n => { FractionalDollar = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fraction", Fraction); + writer.WriteObjectValue("fractionalDollar", FractionalDollar); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarDe/DollarDeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarDe/DollarDeRequestBuilder.cs new file mode 100644 index 0000000000..c4c42b8758 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarDe/DollarDeRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DollarDe +{ + /// + /// Provides operations to call the dollarDe method. + /// + public class DollarDeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dollarDe + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dollarDe"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DollarDePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DollarDeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dollarDe", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DollarDeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dollarDe", rawUrl) + { + } + /// + /// Invoke action dollarDe + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DollarDePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DollarDePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarFr/DollarFrPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarFr/DollarFrPostRequestBody.cs new file mode 100644 index 0000000000..dfc4049bf8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarFr/DollarFrPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DollarFr +{ + #pragma warning disable CS1591 + public class DollarFrPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The decimalDollar property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DecimalDollar { get; set; } +#nullable restore +#else + public Json DecimalDollar { get; set; } +#endif + /// The fraction property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fraction { get; set; } +#nullable restore +#else + public Json Fraction { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DollarFrPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DollarFrPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DollarFrPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "decimalDollar", n => { DecimalDollar = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "fraction", n => { Fraction = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("decimalDollar", DecimalDollar); + writer.WriteObjectValue("fraction", Fraction); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarFr/DollarFrRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarFr/DollarFrRequestBuilder.cs new file mode 100644 index 0000000000..6844166f4e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DollarFr/DollarFrRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DollarFr +{ + /// + /// Provides operations to call the dollarFr method. + /// + public class DollarFrRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dollarFr + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dollarFr"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DollarFrPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DollarFrRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dollarFr", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DollarFrRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dollarFr", rawUrl) + { + } + /// + /// Invoke action dollarFr + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DollarFrPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DollarFrPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dproduct/DproductPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dproduct/DproductPostRequestBody.cs new file mode 100644 index 0000000000..7acb9ce0ca --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dproduct/DproductPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dproduct +{ + #pragma warning disable CS1591 + public class DproductPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DproductPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DproductPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DproductPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dproduct/DproductRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dproduct/DproductRequestBuilder.cs new file mode 100644 index 0000000000..2c73069aad --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dproduct/DproductRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dproduct +{ + /// + /// Provides operations to call the dproduct method. + /// + public class DproductRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dproduct + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dproduct"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DproductPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DproductRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dproduct", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DproductRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dproduct", rawUrl) + { + } + /// + /// Invoke action dproduct + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DproductPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DproductPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDev/DstDevPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDev/DstDevPostRequestBody.cs new file mode 100644 index 0000000000..344e3bfff6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDev/DstDevPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DstDev +{ + #pragma warning disable CS1591 + public class DstDevPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DstDevPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DstDevPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DstDevPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDev/DstDevRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDev/DstDevRequestBuilder.cs new file mode 100644 index 0000000000..428dfbd859 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDev/DstDevRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DstDev +{ + /// + /// Provides operations to call the dstDev method. + /// + public class DstDevRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dstDev + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dstDev"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DstDevPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DstDevRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dstDev", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DstDevRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dstDev", rawUrl) + { + } + /// + /// Invoke action dstDev + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DstDevPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DstDevPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDevP/DstDevPPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDevP/DstDevPPostRequestBody.cs new file mode 100644 index 0000000000..2970ef55f6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDevP/DstDevPPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DstDevP +{ + #pragma warning disable CS1591 + public class DstDevPPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DstDevPPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DstDevPPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DstDevPPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDevP/DstDevPRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDevP/DstDevPRequestBuilder.cs new file mode 100644 index 0000000000..cea2ad5e17 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DstDevP/DstDevPRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DstDevP +{ + /// + /// Provides operations to call the dstDevP method. + /// + public class DstDevPRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dstDevP + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dstDevP"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DstDevPPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DstDevPRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dstDevP", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DstDevPRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dstDevP", rawUrl) + { + } + /// + /// Invoke action dstDevP + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DstDevPPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DstDevPPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dsum/DsumPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dsum/DsumPostRequestBody.cs new file mode 100644 index 0000000000..3ad4b8c97f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dsum/DsumPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dsum +{ + #pragma warning disable CS1591 + public class DsumPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DsumPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DsumPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DsumPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dsum/DsumRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dsum/DsumRequestBuilder.cs new file mode 100644 index 0000000000..214181914f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dsum/DsumRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dsum +{ + /// + /// Provides operations to call the dsum method. + /// + public class DsumRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dsum + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dsum"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DsumPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DsumRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dsum", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DsumRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dsum", rawUrl) + { + } + /// + /// Invoke action dsum + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DsumPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DsumPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Duration/DurationPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Duration/DurationPostRequestBody.cs new file mode 100644 index 0000000000..798abb8aa3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Duration/DurationPostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Duration +{ + #pragma warning disable CS1591 + public class DurationPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The coupon property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Coupon { get; set; } +#nullable restore +#else + public Json Coupon { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// The yld property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Yld { get; set; } +#nullable restore +#else + public Json Yld { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DurationPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DurationPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DurationPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "coupon", n => { Coupon = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "yld", n => { Yld = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("coupon", Coupon); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteObjectValue("yld", Yld); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Duration/DurationRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Duration/DurationRequestBuilder.cs new file mode 100644 index 0000000000..b13cd4ea35 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Duration/DurationRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Duration +{ + /// + /// Provides operations to call the duration method. + /// + public class DurationRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action duration + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action duration"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DurationPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DurationRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/duration", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DurationRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/duration", rawUrl) + { + } + /// + /// Invoke action duration + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DurationPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DurationPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dvar/DvarPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dvar/DvarPostRequestBody.cs new file mode 100644 index 0000000000..658adaeffa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dvar/DvarPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dvar +{ + #pragma warning disable CS1591 + public class DvarPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DvarPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DvarPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DvarPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dvar/DvarRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dvar/DvarRequestBuilder.cs new file mode 100644 index 0000000000..7b91d891d3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Dvar/DvarRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dvar +{ + /// + /// Provides operations to call the dvar method. + /// + public class DvarRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dvar + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dvar"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DvarPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DvarRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dvar", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DvarRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dvar", rawUrl) + { + } + /// + /// Invoke action dvar + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DvarPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DvarPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DvarP/DvarPPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DvarP/DvarPPostRequestBody.cs new file mode 100644 index 0000000000..dcbbb9e2d9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DvarP/DvarPPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DvarP +{ + #pragma warning disable CS1591 + public class DvarPPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The database property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Database { get; set; } +#nullable restore +#else + public Json Database { get; set; } +#endif + /// The field property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Field { get; set; } +#nullable restore +#else + public Json Field { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DvarPPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static DvarPPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DvarPPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "database", n => { Database = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "field", n => { Field = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("database", Database); + writer.WriteObjectValue("field", Field); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DvarP/DvarPRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DvarP/DvarPRequestBuilder.cs new file mode 100644 index 0000000000..de40985770 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/DvarP/DvarPRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DvarP +{ + /// + /// Provides operations to call the dvarP method. + /// + public class DvarPRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action dvarP + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action dvarP"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DvarPPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DvarPRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dvarP", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DvarPRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/dvarP", rawUrl) + { + } + /// + /// Invoke action dvarP + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DvarPPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DvarPPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingPostRequestBody.cs new file mode 100644 index 0000000000..be0abf3ef0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ecma_Ceiling +{ + #pragma warning disable CS1591 + public class Ecma_CeilingPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The significance property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Significance { get; set; } +#nullable restore +#else + public Json Significance { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Ecma_CeilingPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Ecma_CeilingPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Ecma_CeilingPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "significance", n => { Significance = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("significance", Significance); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingRequestBuilder.cs new file mode 100644 index 0000000000..dec97a579c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ecma_Ceiling/Ecma_CeilingRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ecma_Ceiling +{ + /// + /// Provides operations to call the ecma_Ceiling method. + /// + public class Ecma_CeilingRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action ecma_Ceiling + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action ecma_Ceiling"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Ecma_CeilingPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Ecma_CeilingRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ecma_Ceiling", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Ecma_CeilingRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ecma_Ceiling", rawUrl) + { + } + /// + /// Invoke action ecma_Ceiling + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Ecma_CeilingPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Ecma_CeilingPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Edate/EdatePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Edate/EdatePostRequestBody.cs new file mode 100644 index 0000000000..c4b6604b6c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Edate/EdatePostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Edate +{ + #pragma warning disable CS1591 + public class EdatePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The months property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Months { get; set; } +#nullable restore +#else + public Json Months { get; set; } +#endif + /// The startDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartDate { get; set; } +#nullable restore +#else + public Json StartDate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EdatePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static EdatePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EdatePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "months", n => { Months = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startDate", n => { StartDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("months", Months); + writer.WriteObjectValue("startDate", StartDate); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Edate/EdateRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Edate/EdateRequestBuilder.cs new file mode 100644 index 0000000000..7cd9c92997 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Edate/EdateRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Edate +{ + /// + /// Provides operations to call the edate method. + /// + public class EdateRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action edate + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action edate"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(EdatePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public EdateRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/edate", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public EdateRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/edate", rawUrl) + { + } + /// + /// Invoke action edate + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(EdatePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(EdatePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Effect/EffectPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Effect/EffectPostRequestBody.cs new file mode 100644 index 0000000000..df1e3fcbbb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Effect/EffectPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Effect +{ + #pragma warning disable CS1591 + public class EffectPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The nominalRate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NominalRate { get; set; } +#nullable restore +#else + public Json NominalRate { get; set; } +#endif + /// The npery property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Npery { get; set; } +#nullable restore +#else + public Json Npery { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EffectPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static EffectPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EffectPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "nominalRate", n => { NominalRate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "npery", n => { Npery = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("nominalRate", NominalRate); + writer.WriteObjectValue("npery", Npery); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Effect/EffectRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Effect/EffectRequestBuilder.cs new file mode 100644 index 0000000000..bd0db06507 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Effect/EffectRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Effect +{ + /// + /// Provides operations to call the effect method. + /// + public class EffectRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action effect + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action effect"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(EffectPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public EffectRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/effect", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public EffectRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/effect", rawUrl) + { + } + /// + /// Invoke action effect + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(EffectPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(EffectPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/EoMonth/EoMonthPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/EoMonth/EoMonthPostRequestBody.cs new file mode 100644 index 0000000000..49cec4395b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/EoMonth/EoMonthPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.EoMonth +{ + #pragma warning disable CS1591 + public class EoMonthPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The months property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Months { get; set; } +#nullable restore +#else + public Json Months { get; set; } +#endif + /// The startDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartDate { get; set; } +#nullable restore +#else + public Json StartDate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EoMonthPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static EoMonthPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EoMonthPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "months", n => { Months = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startDate", n => { StartDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("months", Months); + writer.WriteObjectValue("startDate", StartDate); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/EoMonth/EoMonthRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/EoMonth/EoMonthRequestBuilder.cs new file mode 100644 index 0000000000..89e395bf16 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/EoMonth/EoMonthRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.EoMonth +{ + /// + /// Provides operations to call the eoMonth method. + /// + public class EoMonthRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action eoMonth + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action eoMonth"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(EoMonthPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public EoMonthRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/eoMonth", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public EoMonthRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/eoMonth", rawUrl) + { + } + /// + /// Invoke action eoMonth + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(EoMonthPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(EoMonthPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf/ErfPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf/ErfPostRequestBody.cs new file mode 100644 index 0000000000..f11fa121d9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf/ErfPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Erf +{ + #pragma warning disable CS1591 + public class ErfPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The lowerLimit property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LowerLimit { get; set; } +#nullable restore +#else + public Json LowerLimit { get; set; } +#endif + /// The upperLimit property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? UpperLimit { get; set; } +#nullable restore +#else + public Json UpperLimit { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ErfPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ErfPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ErfPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "lowerLimit", n => { LowerLimit = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "upperLimit", n => { UpperLimit = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("lowerLimit", LowerLimit); + writer.WriteObjectValue("upperLimit", UpperLimit); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf/ErfRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf/ErfRequestBuilder.cs new file mode 100644 index 0000000000..26582f2060 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf/ErfRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Erf +{ + /// + /// Provides operations to call the erf method. + /// + public class ErfRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action erf + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action erf"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ErfPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ErfRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/erf", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ErfRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/erf", rawUrl) + { + } + /// + /// Invoke action erf + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ErfPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ErfPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC/ErfCPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC/ErfCPostRequestBody.cs new file mode 100644 index 0000000000..01235057d8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC/ErfCPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ErfC +{ + #pragma warning disable CS1591 + public class ErfCPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ErfCPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ErfCPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ErfCPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC/ErfCRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC/ErfCRequestBuilder.cs new file mode 100644 index 0000000000..d41585993b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC/ErfCRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ErfC +{ + /// + /// Provides operations to call the erfC method. + /// + public class ErfCRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action erfC + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action erfC"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ErfCPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ErfCRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/erfC", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ErfCRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/erfC", rawUrl) + { + } + /// + /// Invoke action erfC + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ErfCPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ErfCPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC_Precise/ErfC_PrecisePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC_Precise/ErfC_PrecisePostRequestBody.cs new file mode 100644 index 0000000000..79cc5abb3a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC_Precise/ErfC_PrecisePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ErfC_Precise +{ + #pragma warning disable CS1591 + public class ErfC_PrecisePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The X property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ErfC_PrecisePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ErfC_PrecisePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ErfC_PrecisePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "X", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("X", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC_Precise/ErfC_PreciseRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC_Precise/ErfC_PreciseRequestBuilder.cs new file mode 100644 index 0000000000..f1cfdb30c1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ErfC_Precise/ErfC_PreciseRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ErfC_Precise +{ + /// + /// Provides operations to call the erfC_Precise method. + /// + public class ErfC_PreciseRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action erfC_Precise + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action erfC_Precise"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ErfC_PrecisePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ErfC_PreciseRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/erfC_Precise", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ErfC_PreciseRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/erfC_Precise", rawUrl) + { + } + /// + /// Invoke action erfC_Precise + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ErfC_PrecisePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ErfC_PrecisePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf_Precise/Erf_PrecisePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf_Precise/Erf_PrecisePostRequestBody.cs new file mode 100644 index 0000000000..dfa01c488e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf_Precise/Erf_PrecisePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Erf_Precise +{ + #pragma warning disable CS1591 + public class Erf_PrecisePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The X property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Erf_PrecisePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Erf_PrecisePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Erf_PrecisePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "X", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("X", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf_Precise/Erf_PreciseRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf_Precise/Erf_PreciseRequestBuilder.cs new file mode 100644 index 0000000000..66aa72d81c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Erf_Precise/Erf_PreciseRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Erf_Precise +{ + /// + /// Provides operations to call the erf_Precise method. + /// + public class Erf_PreciseRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action erf_Precise + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action erf_Precise"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Erf_PrecisePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Erf_PreciseRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/erf_Precise", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Erf_PreciseRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/erf_Precise", rawUrl) + { + } + /// + /// Invoke action erf_Precise + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Erf_PrecisePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Erf_PrecisePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Error_Type/Error_TypePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Error_Type/Error_TypePostRequestBody.cs new file mode 100644 index 0000000000..80e663782e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Error_Type/Error_TypePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Error_Type +{ + #pragma warning disable CS1591 + public class Error_TypePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The errorVal property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ErrorVal { get; set; } +#nullable restore +#else + public Json ErrorVal { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Error_TypePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Error_TypePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Error_TypePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "errorVal", n => { ErrorVal = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("errorVal", ErrorVal); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Error_Type/Error_TypeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Error_Type/Error_TypeRequestBuilder.cs new file mode 100644 index 0000000000..1b0da2f06a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Error_Type/Error_TypeRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Error_Type +{ + /// + /// Provides operations to call the error_Type method. + /// + public class Error_TypeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action error_Type + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action error_Type"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Error_TypePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Error_TypeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/error_Type", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Error_TypeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/error_Type", rawUrl) + { + } + /// + /// Invoke action error_Type + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Error_TypePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Error_TypePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Even/EvenPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Even/EvenPostRequestBody.cs new file mode 100644 index 0000000000..9e922f1ab4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Even/EvenPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Even +{ + #pragma warning disable CS1591 + public class EvenPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EvenPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static EvenPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EvenPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Even/EvenRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Even/EvenRequestBuilder.cs new file mode 100644 index 0000000000..4dce3e2ff0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Even/EvenRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Even +{ + /// + /// Provides operations to call the even method. + /// + public class EvenRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action even + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action even"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(EvenPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public EvenRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/even", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public EvenRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/even", rawUrl) + { + } + /// + /// Invoke action even + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(EvenPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(EvenPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exact/ExactPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exact/ExactPostRequestBody.cs new file mode 100644 index 0000000000..8132f381b1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exact/ExactPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Exact +{ + #pragma warning disable CS1591 + public class ExactPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text1 { get; set; } +#nullable restore +#else + public Json Text1 { get; set; } +#endif + /// The text2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text2 { get; set; } +#nullable restore +#else + public Json Text2 { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ExactPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ExactPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExactPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text1", n => { Text1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text2", n => { Text2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text1", Text1); + writer.WriteObjectValue("text2", Text2); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exact/ExactRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exact/ExactRequestBuilder.cs new file mode 100644 index 0000000000..ef77762bf4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exact/ExactRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Exact +{ + /// + /// Provides operations to call the exact method. + /// + public class ExactRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action exact + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action exact"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ExactPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ExactRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/exact", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ExactRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/exact", rawUrl) + { + } + /// + /// Invoke action exact + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ExactPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ExactPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exp/ExpPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exp/ExpPostRequestBody.cs new file mode 100644 index 0000000000..d0abf2e0e2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exp/ExpPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Exp +{ + #pragma warning disable CS1591 + public class ExpPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ExpPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ExpPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExpPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exp/ExpRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exp/ExpRequestBuilder.cs new file mode 100644 index 0000000000..e3df0efab8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Exp/ExpRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Exp +{ + /// + /// Provides operations to call the exp method. + /// + public class ExpRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action exp + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action exp"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ExpPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ExpRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/exp", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ExpRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/exp", rawUrl) + { + } + /// + /// Invoke action exp + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ExpPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ExpPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Expon_Dist/Expon_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Expon_Dist/Expon_DistPostRequestBody.cs new file mode 100644 index 0000000000..646918aaf0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Expon_Dist/Expon_DistPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Expon_Dist +{ + #pragma warning disable CS1591 + public class Expon_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The lambda property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Lambda { get; set; } +#nullable restore +#else + public Json Lambda { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Expon_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Expon_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Expon_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "lambda", n => { Lambda = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("lambda", Lambda); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Expon_Dist/Expon_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Expon_Dist/Expon_DistRequestBuilder.cs new file mode 100644 index 0000000000..7e8763a6ba --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Expon_Dist/Expon_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Expon_Dist +{ + /// + /// Provides operations to call the expon_Dist method. + /// + public class Expon_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action expon_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action expon_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Expon_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Expon_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/expon_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Expon_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/expon_Dist", rawUrl) + { + } + /// + /// Invoke action expon_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Expon_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Expon_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist/F_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist/F_DistPostRequestBody.cs new file mode 100644 index 0000000000..4b7307dba1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist/F_DistPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Dist +{ + #pragma warning disable CS1591 + public class F_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The degFreedom1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom1 { get; set; } +#nullable restore +#else + public Json DegFreedom1 { get; set; } +#endif + /// The degFreedom2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom2 { get; set; } +#nullable restore +#else + public Json DegFreedom2 { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public F_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static F_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new F_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "degFreedom1", n => { DegFreedom1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "degFreedom2", n => { DegFreedom2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("degFreedom1", DegFreedom1); + writer.WriteObjectValue("degFreedom2", DegFreedom2); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist/F_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist/F_DistRequestBuilder.cs new file mode 100644 index 0000000000..8d99129539 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist/F_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Dist +{ + /// + /// Provides operations to call the f_Dist method. + /// + public class F_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action f_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action f_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(F_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public F_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/f_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public F_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/f_Dist", rawUrl) + { + } + /// + /// Invoke action f_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(F_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(F_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTPostRequestBody.cs new file mode 100644 index 0000000000..d999583d2f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Dist_RT +{ + #pragma warning disable CS1591 + public class F_Dist_RTPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom1 { get; set; } +#nullable restore +#else + public Json DegFreedom1 { get; set; } +#endif + /// The degFreedom2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom2 { get; set; } +#nullable restore +#else + public Json DegFreedom2 { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public F_Dist_RTPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static F_Dist_RTPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new F_Dist_RTPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom1", n => { DegFreedom1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "degFreedom2", n => { DegFreedom2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom1", DegFreedom1); + writer.WriteObjectValue("degFreedom2", DegFreedom2); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTRequestBuilder.cs new file mode 100644 index 0000000000..ee26a8f40e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Dist_RT/F_Dist_RTRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Dist_RT +{ + /// + /// Provides operations to call the f_Dist_RT method. + /// + public class F_Dist_RTRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action f_Dist_RT + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action f_Dist_RT"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(F_Dist_RTPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public F_Dist_RTRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/f_Dist_RT", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public F_Dist_RTRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/f_Dist_RT", rawUrl) + { + } + /// + /// Invoke action f_Dist_RT + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(F_Dist_RTPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(F_Dist_RTPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv/F_InvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv/F_InvPostRequestBody.cs new file mode 100644 index 0000000000..bbc328dd05 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv/F_InvPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Inv +{ + #pragma warning disable CS1591 + public class F_InvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom1 { get; set; } +#nullable restore +#else + public Json DegFreedom1 { get; set; } +#endif + /// The degFreedom2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom2 { get; set; } +#nullable restore +#else + public Json DegFreedom2 { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public F_InvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static F_InvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new F_InvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom1", n => { DegFreedom1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "degFreedom2", n => { DegFreedom2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom1", DegFreedom1); + writer.WriteObjectValue("degFreedom2", DegFreedom2); + writer.WriteObjectValue("probability", Probability); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv/F_InvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv/F_InvRequestBuilder.cs new file mode 100644 index 0000000000..4b3a7c3fe8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv/F_InvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Inv +{ + /// + /// Provides operations to call the f_Inv method. + /// + public class F_InvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action f_Inv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action f_Inv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(F_InvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public F_InvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/f_Inv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public F_InvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/f_Inv", rawUrl) + { + } + /// + /// Invoke action f_Inv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(F_InvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(F_InvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTPostRequestBody.cs new file mode 100644 index 0000000000..df808491a7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Inv_RT +{ + #pragma warning disable CS1591 + public class F_Inv_RTPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom1 { get; set; } +#nullable restore +#else + public Json DegFreedom1 { get; set; } +#endif + /// The degFreedom2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom2 { get; set; } +#nullable restore +#else + public Json DegFreedom2 { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public F_Inv_RTPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static F_Inv_RTPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new F_Inv_RTPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom1", n => { DegFreedom1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "degFreedom2", n => { DegFreedom2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom1", DegFreedom1); + writer.WriteObjectValue("degFreedom2", DegFreedom2); + writer.WriteObjectValue("probability", Probability); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTRequestBuilder.cs new file mode 100644 index 0000000000..a90b7c3fc7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/F_Inv_RT/F_Inv_RTRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Inv_RT +{ + /// + /// Provides operations to call the f_Inv_RT method. + /// + public class F_Inv_RTRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action f_Inv_RT + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action f_Inv_RT"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(F_Inv_RTPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public F_Inv_RTRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/f_Inv_RT", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public F_Inv_RTRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/f_Inv_RT", rawUrl) + { + } + /// + /// Invoke action f_Inv_RT + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(F_Inv_RTPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(F_Inv_RTPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fact/FactPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fact/FactPostRequestBody.cs new file mode 100644 index 0000000000..aab35ca98c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fact/FactPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fact +{ + #pragma warning disable CS1591 + public class FactPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FactPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FactPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FactPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fact/FactRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fact/FactRequestBuilder.cs new file mode 100644 index 0000000000..5a5bfaa4c3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fact/FactRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fact +{ + /// + /// Provides operations to call the fact method. + /// + public class FactRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action fact + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action fact"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FactPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FactRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fact", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FactRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fact", rawUrl) + { + } + /// + /// Invoke action fact + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FactPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FactPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FactDouble/FactDoublePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FactDouble/FactDoublePostRequestBody.cs new file mode 100644 index 0000000000..9086b66367 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FactDouble/FactDoublePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.FactDouble +{ + #pragma warning disable CS1591 + public class FactDoublePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FactDoublePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FactDoublePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FactDoublePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FactDouble/FactDoubleRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FactDouble/FactDoubleRequestBuilder.cs new file mode 100644 index 0000000000..384bc0876c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FactDouble/FactDoubleRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.FactDouble +{ + /// + /// Provides operations to call the factDouble method. + /// + public class FactDoubleRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action factDouble + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action factDouble"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FactDoublePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FactDoubleRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/factDouble", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FactDoubleRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/factDouble", rawUrl) + { + } + /// + /// Invoke action factDouble + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FactDoublePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FactDoublePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/False/FalseRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/False/FalseRequestBuilder.cs new file mode 100644 index 0000000000..79f9413121 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/False/FalseRequestBuilder.cs @@ -0,0 +1,102 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.False +{ + /// + /// Provides operations to call the false method. + /// + public class FalseRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action false + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action false"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FalseRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/false", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FalseRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/false", rawUrl) + { + } + /// + /// Invoke action false + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Find/FindPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Find/FindPostRequestBody.cs new file mode 100644 index 0000000000..90c891eefd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Find/FindPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Find +{ + #pragma warning disable CS1591 + public class FindPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The findText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FindText { get; set; } +#nullable restore +#else + public Json FindText { get; set; } +#endif + /// The startNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartNum { get; set; } +#nullable restore +#else + public Json StartNum { get; set; } +#endif + /// The withinText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? WithinText { get; set; } +#nullable restore +#else + public Json WithinText { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FindPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FindPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FindPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "findText", n => { FindText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startNum", n => { StartNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "withinText", n => { WithinText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("findText", FindText); + writer.WriteObjectValue("startNum", StartNum); + writer.WriteObjectValue("withinText", WithinText); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Find/FindRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Find/FindRequestBuilder.cs new file mode 100644 index 0000000000..6727809a03 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Find/FindRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Find +{ + /// + /// Provides operations to call the find method. + /// + public class FindRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action find + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action find"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FindPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FindRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/find", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FindRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/find", rawUrl) + { + } + /// + /// Invoke action find + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FindPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FindPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FindB/FindBPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FindB/FindBPostRequestBody.cs new file mode 100644 index 0000000000..8f3814828f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FindB/FindBPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.FindB +{ + #pragma warning disable CS1591 + public class FindBPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The findText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FindText { get; set; } +#nullable restore +#else + public Json FindText { get; set; } +#endif + /// The startNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartNum { get; set; } +#nullable restore +#else + public Json StartNum { get; set; } +#endif + /// The withinText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? WithinText { get; set; } +#nullable restore +#else + public Json WithinText { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FindBPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FindBPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FindBPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "findText", n => { FindText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startNum", n => { StartNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "withinText", n => { WithinText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("findText", FindText); + writer.WriteObjectValue("startNum", StartNum); + writer.WriteObjectValue("withinText", WithinText); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FindB/FindBRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FindB/FindBRequestBuilder.cs new file mode 100644 index 0000000000..15a414527d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FindB/FindBRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.FindB +{ + /// + /// Provides operations to call the findB method. + /// + public class FindBRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action findB + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action findB"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FindBPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FindBRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/findB", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FindBRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/findB", rawUrl) + { + } + /// + /// Invoke action findB + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FindBPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FindBPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fisher/FisherPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fisher/FisherPostRequestBody.cs new file mode 100644 index 0000000000..b6757a8d36 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fisher/FisherPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fisher +{ + #pragma warning disable CS1591 + public class FisherPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FisherPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FisherPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FisherPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fisher/FisherRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fisher/FisherRequestBuilder.cs new file mode 100644 index 0000000000..081ad6526b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fisher/FisherRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fisher +{ + /// + /// Provides operations to call the fisher method. + /// + public class FisherRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action fisher + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action fisher"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FisherPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FisherRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fisher", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FisherRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fisher", rawUrl) + { + } + /// + /// Invoke action fisher + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FisherPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FisherPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FisherInv/FisherInvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FisherInv/FisherInvPostRequestBody.cs new file mode 100644 index 0000000000..ad5110237e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FisherInv/FisherInvPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.FisherInv +{ + #pragma warning disable CS1591 + public class FisherInvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The y property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Y { get; set; } +#nullable restore +#else + public Json Y { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FisherInvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FisherInvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FisherInvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "y", n => { Y = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("y", Y); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FisherInv/FisherInvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FisherInv/FisherInvRequestBuilder.cs new file mode 100644 index 0000000000..3a78a5ecfd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FisherInv/FisherInvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.FisherInv +{ + /// + /// Provides operations to call the fisherInv method. + /// + public class FisherInvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action fisherInv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action fisherInv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FisherInvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FisherInvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fisherInv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FisherInvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fisherInv", rawUrl) + { + } + /// + /// Invoke action fisherInv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FisherInvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FisherInvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fixed/FixedPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fixed/FixedPostRequestBody.cs new file mode 100644 index 0000000000..9888e587b8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fixed/FixedPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fixed +{ + #pragma warning disable CS1591 + public class FixedPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The decimals property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Decimals { get; set; } +#nullable restore +#else + public Json Decimals { get; set; } +#endif + /// The noCommas property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NoCommas { get; set; } +#nullable restore +#else + public Json NoCommas { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FixedPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FixedPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FixedPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "decimals", n => { Decimals = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "noCommas", n => { NoCommas = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("decimals", Decimals); + writer.WriteObjectValue("noCommas", NoCommas); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fixed/FixedRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fixed/FixedRequestBuilder.cs new file mode 100644 index 0000000000..4e4216b509 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fixed/FixedRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fixed +{ + /// + /// Provides operations to call the fixed method. + /// + public class FixedRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action fixed + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action fixed"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FixedPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FixedRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fixed", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FixedRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fixed", rawUrl) + { + } + /// + /// Invoke action fixed + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FixedPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FixedPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Math/Floor_MathPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Math/Floor_MathPostRequestBody.cs new file mode 100644 index 0000000000..783b859f41 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Math/Floor_MathPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Floor_Math +{ + #pragma warning disable CS1591 + public class Floor_MathPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The mode property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Mode { get; set; } +#nullable restore +#else + public Json Mode { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The significance property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Significance { get; set; } +#nullable restore +#else + public Json Significance { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Floor_MathPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Floor_MathPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Floor_MathPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "mode", n => { Mode = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "significance", n => { Significance = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mode", Mode); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("significance", Significance); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Math/Floor_MathRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Math/Floor_MathRequestBuilder.cs new file mode 100644 index 0000000000..dc2c4b8bce --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Math/Floor_MathRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Floor_Math +{ + /// + /// Provides operations to call the floor_Math method. + /// + public class Floor_MathRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action floor_Math + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action floor_Math"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Floor_MathPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Floor_MathRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/floor_Math", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Floor_MathRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/floor_Math", rawUrl) + { + } + /// + /// Invoke action floor_Math + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Floor_MathPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Floor_MathPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Precise/Floor_PrecisePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Precise/Floor_PrecisePostRequestBody.cs new file mode 100644 index 0000000000..a0c28987c4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Precise/Floor_PrecisePostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Floor_Precise +{ + #pragma warning disable CS1591 + public class Floor_PrecisePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The significance property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Significance { get; set; } +#nullable restore +#else + public Json Significance { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Floor_PrecisePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Floor_PrecisePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Floor_PrecisePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "significance", n => { Significance = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("significance", Significance); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Precise/Floor_PreciseRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Precise/Floor_PreciseRequestBuilder.cs new file mode 100644 index 0000000000..421e2263bd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Floor_Precise/Floor_PreciseRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Floor_Precise +{ + /// + /// Provides operations to call the floor_Precise method. + /// + public class Floor_PreciseRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action floor_Precise + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action floor_Precise"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Floor_PrecisePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Floor_PreciseRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/floor_Precise", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Floor_PreciseRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/floor_Precise", rawUrl) + { + } + /// + /// Invoke action floor_Precise + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Floor_PrecisePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Floor_PrecisePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FunctionsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FunctionsRequestBuilder.cs new file mode 100644 index 0000000000..6423ab8d37 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/FunctionsRequestBuilder.cs @@ -0,0 +1,6868 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Abs; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AccrInt; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AccrIntM; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acos; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acosh; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acot; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Acoth; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AmorDegrc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AmorLinc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.And; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Arabic; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Areas; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Asc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Asin; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Asinh; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Atan2; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Atan; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Atanh; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AveDev; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Average; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AverageA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AverageIf; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.AverageIfs; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BahtText; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Base; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselI; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselJ; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselK; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.BesselY; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Beta_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Beta_Inv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bin2Dec; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bin2Hex; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bin2Oct; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Binom_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Binom_Dist_Range; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Binom_Inv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitand; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitlshift; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitor; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitrshift; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Bitxor; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ceiling_Math; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ceiling_Precise; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CharNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Dist_RT; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Inv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ChiSq_Inv_RT; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Choose; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Clean; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Code; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Columns; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Combin; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Combina; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Complex; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Concatenate; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Confidence_Norm; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Confidence_T; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ConvertNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Cos; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Cosh; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Cot; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Coth; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountBlank; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountIf; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CountIfs; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupDayBs; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupDays; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupDaysNc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupNcd; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupNum; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CoupPcd; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Csc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Csch; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CumIPmt; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.CumPrinc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DateNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Datevalue; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Daverage; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Day; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Days360; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Days; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Db; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dbcs; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dcount; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DcountA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ddb; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dec2Bin; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dec2Hex; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dec2Oct; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DecimalNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Degrees; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Delta; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DevSq; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dget; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Disc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dmax; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dmin; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dollar; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DollarDe; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DollarFr; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dproduct; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DstDev; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DstDevP; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dsum; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Duration; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Dvar; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.DvarP; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ecma_Ceiling; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Edate; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Effect; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.EoMonth; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Erf; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ErfC; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ErfC_Precise; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Erf_Precise; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Error_Type; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Even; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Exact; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Exp; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Expon_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Dist_RT; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Inv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.F_Inv_RT; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fact; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.FactDouble; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.False; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Find; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.FindB; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fisher; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.FisherInv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fixed; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Floor_Math; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Floor_Precise; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fvschedule; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gamma; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GammaLn; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GammaLn_Precise; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gamma_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gamma_Inv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gauss; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gcd; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GeStep; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GeoMean; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.HarMean; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hex2Bin; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hex2Dec; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hex2Oct; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hlookup; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hour; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.HypGeom_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hyperlink; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.If; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImAbs; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImArgument; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImConjugate; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCos; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCosh; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCot; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCsc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCsch; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImDiv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImExp; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImLn; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImLog10; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImLog2; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImPower; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImProduct; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImReal; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSec; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSech; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSin; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSinh; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSqrt; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSub; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSum; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImTan; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Imaginary; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Int; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IntRate; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ipmt; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Irr; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsErr; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsError; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsEven; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsFormula; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsLogical; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsNA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsNonText; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsNumber; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsOdd; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsText; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsoWeekNum; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Iso_Ceiling; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ispmt; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Isref; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Kurt; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Large; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lcm; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Left; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Leftb; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Len; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lenb; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ln; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Log10; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Log; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.LogNorm_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.LogNorm_Inv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lookup; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lower; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Match; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Max; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.MaxA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mduration; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Median; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mid; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Midb; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Min; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.MinA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Minute; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mirr; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mod; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Month; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mround; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.MultiNomial; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.N; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Na; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NegBinom_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NetworkDays; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NetworkDays_Intl; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Nominal; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_Inv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_S_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_S_Inv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Not; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Now; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Nper; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Npv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NumberValue; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Oct2Bin; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Oct2Dec; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Oct2Hex; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Odd; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddFPrice; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddFYield; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddLPrice; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddLYield; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Or; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pduration; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PercentRank_Exc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PercentRank_Inc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Percentile_Exc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Percentile_Inc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Permut; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Permutationa; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Phi; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pi; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pmt; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Poisson_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Power; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ppmt; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Price; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PriceDisc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PriceMat; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Product; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Proper; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Quartile_Exc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Quartile_Inc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Quotient; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Radians; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rand; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.RandBetween; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rank_Avg; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rank_Eq; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rate; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Received; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Replace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ReplaceB; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rept; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Right; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rightb; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Roman; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Round; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.RoundDown; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.RoundUp; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rows; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rri; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sec; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sech; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Second; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SeriesSum; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sheet; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sheets; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sign; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sin; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sinh; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Skew; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Skew_p; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sln; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Small; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sqrt; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SqrtPi; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDevA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDevPA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDev_P; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDev_S; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Standardize; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Substitute; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Subtotal; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sum; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SumIf; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SumIfs; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SumSq; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Syd; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Dist_2T; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Dist_RT; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Inv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Inv_2T; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Tan; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Tanh; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TbillEq; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TbillPrice; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TbillYield; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Text; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Time; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Timevalue; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Today; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Trim; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TrimMean; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.True; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Trunc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TypeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Unichar; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Unicode; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Upper; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Usdollar; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Value; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.VarA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.VarPA; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Var_P; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Var_S; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Vdb; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Vlookup; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.WeekNum; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Weekday; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Weibull_Dist; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.WorkDay; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.WorkDay_Intl; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Xirr; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Xnpv; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Xor; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Year; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.YearFrac; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Yield; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.YieldDisc; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.YieldMat; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Z_Test; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions +{ + /// + /// Provides operations to manage the functions property of the microsoft.graph.workbook entity. + /// + public class FunctionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the abs method. + /// + /// A + public Command BuildAbsNavCommand() + { + var command = new Command("abs"); + command.Description = "Provides operations to call the abs method."; + var builder = new AbsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the accrIntM method. + /// + /// A + public Command BuildAccrIntMNavCommand() + { + var command = new Command("accr-int-m"); + command.Description = "Provides operations to call the accrIntM method."; + var builder = new AccrIntMRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the accrInt method. + /// + /// A + public Command BuildAccrIntNavCommand() + { + var command = new Command("accr-int"); + command.Description = "Provides operations to call the accrInt method."; + var builder = new AccrIntRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the acosh method. + /// + /// A + public Command BuildAcoshNavCommand() + { + var command = new Command("acosh"); + command.Description = "Provides operations to call the acosh method."; + var builder = new AcoshRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the acos method. + /// + /// A + public Command BuildAcosNavCommand() + { + var command = new Command("acos"); + command.Description = "Provides operations to call the acos method."; + var builder = new AcosRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the acoth method. + /// + /// A + public Command BuildAcothNavCommand() + { + var command = new Command("acoth"); + command.Description = "Provides operations to call the acoth method."; + var builder = new AcothRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the acot method. + /// + /// A + public Command BuildAcotNavCommand() + { + var command = new Command("acot"); + command.Description = "Provides operations to call the acot method."; + var builder = new AcotRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the amorDegrc method. + /// + /// A + public Command BuildAmorDegrcNavCommand() + { + var command = new Command("amor-degrc"); + command.Description = "Provides operations to call the amorDegrc method."; + var builder = new AmorDegrcRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the amorLinc method. + /// + /// A + public Command BuildAmorLincNavCommand() + { + var command = new Command("amor-linc"); + command.Description = "Provides operations to call the amorLinc method."; + var builder = new AmorLincRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the and method. + /// + /// A + public Command BuildAndNavCommand() + { + var command = new Command("and"); + command.Description = "Provides operations to call the and method."; + var builder = new AndRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the arabic method. + /// + /// A + public Command BuildArabicNavCommand() + { + var command = new Command("arabic"); + command.Description = "Provides operations to call the arabic method."; + var builder = new ArabicRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the areas method. + /// + /// A + public Command BuildAreasNavCommand() + { + var command = new Command("areas"); + command.Description = "Provides operations to call the areas method."; + var builder = new AreasRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the asc method. + /// + /// A + public Command BuildAscNavCommand() + { + var command = new Command("asc"); + command.Description = "Provides operations to call the asc method."; + var builder = new AscRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the asinh method. + /// + /// A + public Command BuildAsinhNavCommand() + { + var command = new Command("asinh"); + command.Description = "Provides operations to call the asinh method."; + var builder = new AsinhRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the asin method. + /// + /// A + public Command BuildAsinNavCommand() + { + var command = new Command("asin"); + command.Description = "Provides operations to call the asin method."; + var builder = new AsinRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the atan2 method. + /// + /// A + public Command BuildAtan2NavCommand() + { + var command = new Command("atan2"); + command.Description = "Provides operations to call the atan2 method."; + var builder = new Atan2RequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the atanh method. + /// + /// A + public Command BuildAtanhNavCommand() + { + var command = new Command("atanh"); + command.Description = "Provides operations to call the atanh method."; + var builder = new AtanhRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the atan method. + /// + /// A + public Command BuildAtanNavCommand() + { + var command = new Command("atan"); + command.Description = "Provides operations to call the atan method."; + var builder = new AtanRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the aveDev method. + /// + /// A + public Command BuildAveDevNavCommand() + { + var command = new Command("ave-dev"); + command.Description = "Provides operations to call the aveDev method."; + var builder = new AveDevRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the averageA method. + /// + /// A + public Command BuildAverageANavCommand() + { + var command = new Command("average-a"); + command.Description = "Provides operations to call the averageA method."; + var builder = new AverageARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the averageIf method. + /// + /// A + public Command BuildAverageIfNavCommand() + { + var command = new Command("average-if"); + command.Description = "Provides operations to call the averageIf method."; + var builder = new AverageIfRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the averageIfs method. + /// + /// A + public Command BuildAverageIfsNavCommand() + { + var command = new Command("average-ifs"); + command.Description = "Provides operations to call the averageIfs method."; + var builder = new AverageIfsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the average method. + /// + /// A + public Command BuildAverageNavCommand() + { + var command = new Command("average"); + command.Description = "Provides operations to call the average method."; + var builder = new AverageRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the bahtText method. + /// + /// A + public Command BuildBahtTextNavCommand() + { + var command = new Command("baht-text"); + command.Description = "Provides operations to call the bahtText method."; + var builder = new BahtTextRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the base method. + /// + /// A + public Command BuildBaseNavCommand() + { + var command = new Command("base"); + command.Description = "Provides operations to call the base method."; + var builder = new BaseRequestBuilderEscaped(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the besselI method. + /// + /// A + public Command BuildBesselINavCommand() + { + var command = new Command("bessel-i"); + command.Description = "Provides operations to call the besselI method."; + var builder = new BesselIRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the besselJ method. + /// + /// A + public Command BuildBesselJNavCommand() + { + var command = new Command("bessel-j"); + command.Description = "Provides operations to call the besselJ method."; + var builder = new BesselJRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the besselK method. + /// + /// A + public Command BuildBesselKNavCommand() + { + var command = new Command("bessel-k"); + command.Description = "Provides operations to call the besselK method."; + var builder = new BesselKRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the besselY method. + /// + /// A + public Command BuildBesselYNavCommand() + { + var command = new Command("bessel-y"); + command.Description = "Provides operations to call the besselY method."; + var builder = new BesselYRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the beta_Dist method. + /// + /// A + public Command BuildBeta_DistNavCommand() + { + var command = new Command("beta_-dist"); + command.Description = "Provides operations to call the beta_Dist method."; + var builder = new Beta_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the beta_Inv method. + /// + /// A + public Command BuildBeta_InvNavCommand() + { + var command = new Command("beta_-inv"); + command.Description = "Provides operations to call the beta_Inv method."; + var builder = new Beta_InvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the bin2Dec method. + /// + /// A + public Command BuildBin2DecNavCommand() + { + var command = new Command("bin2-dec"); + command.Description = "Provides operations to call the bin2Dec method."; + var builder = new Bin2DecRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the bin2Hex method. + /// + /// A + public Command BuildBin2HexNavCommand() + { + var command = new Command("bin2-hex"); + command.Description = "Provides operations to call the bin2Hex method."; + var builder = new Bin2HexRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the bin2Oct method. + /// + /// A + public Command BuildBin2OctNavCommand() + { + var command = new Command("bin2-oct"); + command.Description = "Provides operations to call the bin2Oct method."; + var builder = new Bin2OctRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the binom_Dist_Range method. + /// + /// A + public Command BuildBinom_Dist_RangeNavCommand() + { + var command = new Command("binom_-dist_-range"); + command.Description = "Provides operations to call the binom_Dist_Range method."; + var builder = new Binom_Dist_RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the binom_Dist method. + /// + /// A + public Command BuildBinom_DistNavCommand() + { + var command = new Command("binom_-dist"); + command.Description = "Provides operations to call the binom_Dist method."; + var builder = new Binom_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the binom_Inv method. + /// + /// A + public Command BuildBinom_InvNavCommand() + { + var command = new Command("binom_-inv"); + command.Description = "Provides operations to call the binom_Inv method."; + var builder = new Binom_InvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the bitand method. + /// + /// A + public Command BuildBitandNavCommand() + { + var command = new Command("bitand"); + command.Description = "Provides operations to call the bitand method."; + var builder = new BitandRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the bitlshift method. + /// + /// A + public Command BuildBitlshiftNavCommand() + { + var command = new Command("bitlshift"); + command.Description = "Provides operations to call the bitlshift method."; + var builder = new BitlshiftRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the bitor method. + /// + /// A + public Command BuildBitorNavCommand() + { + var command = new Command("bitor"); + command.Description = "Provides operations to call the bitor method."; + var builder = new BitorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the bitrshift method. + /// + /// A + public Command BuildBitrshiftNavCommand() + { + var command = new Command("bitrshift"); + command.Description = "Provides operations to call the bitrshift method."; + var builder = new BitrshiftRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the bitxor method. + /// + /// A + public Command BuildBitxorNavCommand() + { + var command = new Command("bitxor"); + command.Description = "Provides operations to call the bitxor method."; + var builder = new BitxorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the ceiling_Math method. + /// + /// A + public Command BuildCeiling_MathNavCommand() + { + var command = new Command("ceiling_-math"); + command.Description = "Provides operations to call the ceiling_Math method."; + var builder = new Ceiling_MathRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the ceiling_Precise method. + /// + /// A + public Command BuildCeiling_PreciseNavCommand() + { + var command = new Command("ceiling_-precise"); + command.Description = "Provides operations to call the ceiling_Precise method."; + var builder = new Ceiling_PreciseRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the char method. + /// + /// A + public Command BuildCharNavCommand() + { + var command = new Command("char"); + command.Description = "Provides operations to call the char method."; + var builder = new CharRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the chiSq_Dist_RT method. + /// + /// A + public Command BuildChiSq_Dist_RTNavCommand() + { + var command = new Command("chi-sq_-dist_-r-t"); + command.Description = "Provides operations to call the chiSq_Dist_RT method."; + var builder = new ChiSq_Dist_RTRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the chiSq_Dist method. + /// + /// A + public Command BuildChiSq_DistNavCommand() + { + var command = new Command("chi-sq_-dist"); + command.Description = "Provides operations to call the chiSq_Dist method."; + var builder = new ChiSq_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the chiSq_Inv_RT method. + /// + /// A + public Command BuildChiSq_Inv_RTNavCommand() + { + var command = new Command("chi-sq_-inv_-r-t"); + command.Description = "Provides operations to call the chiSq_Inv_RT method."; + var builder = new ChiSq_Inv_RTRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the chiSq_Inv method. + /// + /// A + public Command BuildChiSq_InvNavCommand() + { + var command = new Command("chi-sq_-inv"); + command.Description = "Provides operations to call the chiSq_Inv method."; + var builder = new ChiSq_InvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the choose method. + /// + /// A + public Command BuildChooseNavCommand() + { + var command = new Command("choose"); + command.Description = "Provides operations to call the choose method."; + var builder = new ChooseRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the clean method. + /// + /// A + public Command BuildCleanNavCommand() + { + var command = new Command("clean"); + command.Description = "Provides operations to call the clean method."; + var builder = new CleanRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the code method. + /// + /// A + public Command BuildCodeNavCommand() + { + var command = new Command("code"); + command.Description = "Provides operations to call the code method."; + var builder = new CodeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the columns method. + /// + /// A + public Command BuildColumnsNavCommand() + { + var command = new Command("columns"); + command.Description = "Provides operations to call the columns method."; + var builder = new ColumnsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the combina method. + /// + /// A + public Command BuildCombinaNavCommand() + { + var command = new Command("combina"); + command.Description = "Provides operations to call the combina method."; + var builder = new CombinaRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the combin method. + /// + /// A + public Command BuildCombinNavCommand() + { + var command = new Command("combin"); + command.Description = "Provides operations to call the combin method."; + var builder = new CombinRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the complex method. + /// + /// A + public Command BuildComplexNavCommand() + { + var command = new Command("complex"); + command.Description = "Provides operations to call the complex method."; + var builder = new ComplexRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the concatenate method. + /// + /// A + public Command BuildConcatenateNavCommand() + { + var command = new Command("concatenate"); + command.Description = "Provides operations to call the concatenate method."; + var builder = new ConcatenateRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the confidence_Norm method. + /// + /// A + public Command BuildConfidence_NormNavCommand() + { + var command = new Command("confidence_-norm"); + command.Description = "Provides operations to call the confidence_Norm method."; + var builder = new Confidence_NormRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the confidence_T method. + /// + /// A + public Command BuildConfidence_TNavCommand() + { + var command = new Command("confidence_-t"); + command.Description = "Provides operations to call the confidence_T method."; + var builder = new Confidence_TRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the convert method. + /// + /// A + public Command BuildConvertNavCommand() + { + var command = new Command("convert"); + command.Description = "Provides operations to call the convert method."; + var builder = new ConvertRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the cosh method. + /// + /// A + public Command BuildCoshNavCommand() + { + var command = new Command("cosh"); + command.Description = "Provides operations to call the cosh method."; + var builder = new CoshRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the cos method. + /// + /// A + public Command BuildCosNavCommand() + { + var command = new Command("cos"); + command.Description = "Provides operations to call the cos method."; + var builder = new CosRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the coth method. + /// + /// A + public Command BuildCothNavCommand() + { + var command = new Command("coth"); + command.Description = "Provides operations to call the coth method."; + var builder = new CothRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the cot method. + /// + /// A + public Command BuildCotNavCommand() + { + var command = new Command("cot"); + command.Description = "Provides operations to call the cot method."; + var builder = new CotRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the countA method. + /// + /// A + public Command BuildCountANavCommand() + { + var command = new Command("count-a"); + command.Description = "Provides operations to call the countA method."; + var builder = new CountARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the countBlank method. + /// + /// A + public Command BuildCountBlankNavCommand() + { + var command = new Command("count-blank"); + command.Description = "Provides operations to call the countBlank method."; + var builder = new CountBlankRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the countIf method. + /// + /// A + public Command BuildCountIfNavCommand() + { + var command = new Command("count-if"); + command.Description = "Provides operations to call the countIf method."; + var builder = new CountIfRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the countIfs method. + /// + /// A + public Command BuildCountIfsNavCommand() + { + var command = new Command("count-ifs"); + command.Description = "Provides operations to call the countIfs method."; + var builder = new CountIfsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the coupDayBs method. + /// + /// A + public Command BuildCoupDayBsNavCommand() + { + var command = new Command("coup-day-bs"); + command.Description = "Provides operations to call the coupDayBs method."; + var builder = new CoupDayBsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the coupDays method. + /// + /// A + public Command BuildCoupDaysNavCommand() + { + var command = new Command("coup-days"); + command.Description = "Provides operations to call the coupDays method."; + var builder = new CoupDaysRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the coupDaysNc method. + /// + /// A + public Command BuildCoupDaysNcNavCommand() + { + var command = new Command("coup-days-nc"); + command.Description = "Provides operations to call the coupDaysNc method."; + var builder = new CoupDaysNcRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the coupNcd method. + /// + /// A + public Command BuildCoupNcdNavCommand() + { + var command = new Command("coup-ncd"); + command.Description = "Provides operations to call the coupNcd method."; + var builder = new CoupNcdRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the coupNum method. + /// + /// A + public Command BuildCoupNumNavCommand() + { + var command = new Command("coup-num"); + command.Description = "Provides operations to call the coupNum method."; + var builder = new CoupNumRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the coupPcd method. + /// + /// A + public Command BuildCoupPcdNavCommand() + { + var command = new Command("coup-pcd"); + command.Description = "Provides operations to call the coupPcd method."; + var builder = new CoupPcdRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the csch method. + /// + /// A + public Command BuildCschNavCommand() + { + var command = new Command("csch"); + command.Description = "Provides operations to call the csch method."; + var builder = new CschRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the csc method. + /// + /// A + public Command BuildCscNavCommand() + { + var command = new Command("csc"); + command.Description = "Provides operations to call the csc method."; + var builder = new CscRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the cumIPmt method. + /// + /// A + public Command BuildCumIPmtNavCommand() + { + var command = new Command("cum-i-pmt"); + command.Description = "Provides operations to call the cumIPmt method."; + var builder = new CumIPmtRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the cumPrinc method. + /// + /// A + public Command BuildCumPrincNavCommand() + { + var command = new Command("cum-princ"); + command.Description = "Provides operations to call the cumPrinc method."; + var builder = new CumPrincRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the date method. + /// + /// A + public Command BuildDateNavCommand() + { + var command = new Command("date"); + command.Description = "Provides operations to call the date method."; + var builder = new DateRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the datevalue method. + /// + /// A + public Command BuildDatevalueNavCommand() + { + var command = new Command("datevalue"); + command.Description = "Provides operations to call the datevalue method."; + var builder = new DatevalueRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the daverage method. + /// + /// A + public Command BuildDaverageNavCommand() + { + var command = new Command("daverage"); + command.Description = "Provides operations to call the daverage method."; + var builder = new DaverageRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the day method. + /// + /// A + public Command BuildDayNavCommand() + { + var command = new Command("day"); + command.Description = "Provides operations to call the day method."; + var builder = new DayRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the days360 method. + /// + /// A + public Command BuildDays360NavCommand() + { + var command = new Command("days360"); + command.Description = "Provides operations to call the days360 method."; + var builder = new Days360RequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the days method. + /// + /// A + public Command BuildDaysNavCommand() + { + var command = new Command("days"); + command.Description = "Provides operations to call the days method."; + var builder = new DaysRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dbcs method. + /// + /// A + public Command BuildDbcsNavCommand() + { + var command = new Command("dbcs"); + command.Description = "Provides operations to call the dbcs method."; + var builder = new DbcsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the db method. + /// + /// A + public Command BuildDbNavCommand() + { + var command = new Command("db"); + command.Description = "Provides operations to call the db method."; + var builder = new DbRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dcountA method. + /// + /// A + public Command BuildDcountANavCommand() + { + var command = new Command("dcount-a"); + command.Description = "Provides operations to call the dcountA method."; + var builder = new DcountARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dcount method. + /// + /// A + public Command BuildDcountNavCommand() + { + var command = new Command("dcount"); + command.Description = "Provides operations to call the dcount method."; + var builder = new DcountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the ddb method. + /// + /// A + public Command BuildDdbNavCommand() + { + var command = new Command("ddb"); + command.Description = "Provides operations to call the ddb method."; + var builder = new DdbRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dec2Bin method. + /// + /// A + public Command BuildDec2BinNavCommand() + { + var command = new Command("dec2-bin"); + command.Description = "Provides operations to call the dec2Bin method."; + var builder = new Dec2BinRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dec2Hex method. + /// + /// A + public Command BuildDec2HexNavCommand() + { + var command = new Command("dec2-hex"); + command.Description = "Provides operations to call the dec2Hex method."; + var builder = new Dec2HexRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dec2Oct method. + /// + /// A + public Command BuildDec2OctNavCommand() + { + var command = new Command("dec2-oct"); + command.Description = "Provides operations to call the dec2Oct method."; + var builder = new Dec2OctRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the decimal method. + /// + /// A + public Command BuildDecimalNavCommand() + { + var command = new Command("decimal"); + command.Description = "Provides operations to call the decimal method."; + var builder = new DecimalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the degrees method. + /// + /// A + public Command BuildDegreesNavCommand() + { + var command = new Command("degrees"); + command.Description = "Provides operations to call the degrees method."; + var builder = new DegreesRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property functions for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property functions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to call the delta method. + /// + /// A + public Command BuildDeltaNavCommand() + { + var command = new Command("delta"); + command.Description = "Provides operations to call the delta method."; + var builder = new DeltaRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the devSq method. + /// + /// A + public Command BuildDevSqNavCommand() + { + var command = new Command("dev-sq"); + command.Description = "Provides operations to call the devSq method."; + var builder = new DevSqRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dget method. + /// + /// A + public Command BuildDgetNavCommand() + { + var command = new Command("dget"); + command.Description = "Provides operations to call the dget method."; + var builder = new DgetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the disc method. + /// + /// A + public Command BuildDiscNavCommand() + { + var command = new Command("disc"); + command.Description = "Provides operations to call the disc method."; + var builder = new DiscRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dmax method. + /// + /// A + public Command BuildDmaxNavCommand() + { + var command = new Command("dmax"); + command.Description = "Provides operations to call the dmax method."; + var builder = new DmaxRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dmin method. + /// + /// A + public Command BuildDminNavCommand() + { + var command = new Command("dmin"); + command.Description = "Provides operations to call the dmin method."; + var builder = new DminRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dollarDe method. + /// + /// A + public Command BuildDollarDeNavCommand() + { + var command = new Command("dollar-de"); + command.Description = "Provides operations to call the dollarDe method."; + var builder = new DollarDeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dollarFr method. + /// + /// A + public Command BuildDollarFrNavCommand() + { + var command = new Command("dollar-fr"); + command.Description = "Provides operations to call the dollarFr method."; + var builder = new DollarFrRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dollar method. + /// + /// A + public Command BuildDollarNavCommand() + { + var command = new Command("dollar"); + command.Description = "Provides operations to call the dollar method."; + var builder = new DollarRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dproduct method. + /// + /// A + public Command BuildDproductNavCommand() + { + var command = new Command("dproduct"); + command.Description = "Provides operations to call the dproduct method."; + var builder = new DproductRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dstDev method. + /// + /// A + public Command BuildDstDevNavCommand() + { + var command = new Command("dst-dev"); + command.Description = "Provides operations to call the dstDev method."; + var builder = new DstDevRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dstDevP method. + /// + /// A + public Command BuildDstDevPNavCommand() + { + var command = new Command("dst-dev-p"); + command.Description = "Provides operations to call the dstDevP method."; + var builder = new DstDevPRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dsum method. + /// + /// A + public Command BuildDsumNavCommand() + { + var command = new Command("dsum"); + command.Description = "Provides operations to call the dsum method."; + var builder = new DsumRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the duration method. + /// + /// A + public Command BuildDurationNavCommand() + { + var command = new Command("duration"); + command.Description = "Provides operations to call the duration method."; + var builder = new DurationRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dvar method. + /// + /// A + public Command BuildDvarNavCommand() + { + var command = new Command("dvar"); + command.Description = "Provides operations to call the dvar method."; + var builder = new DvarRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dvarP method. + /// + /// A + public Command BuildDvarPNavCommand() + { + var command = new Command("dvar-p"); + command.Description = "Provides operations to call the dvarP method."; + var builder = new DvarPRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the ecma_Ceiling method. + /// + /// A + public Command BuildEcma_CeilingNavCommand() + { + var command = new Command("ecma_-ceiling"); + command.Description = "Provides operations to call the ecma_Ceiling method."; + var builder = new Ecma_CeilingRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the edate method. + /// + /// A + public Command BuildEdateNavCommand() + { + var command = new Command("edate"); + command.Description = "Provides operations to call the edate method."; + var builder = new EdateRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the effect method. + /// + /// A + public Command BuildEffectNavCommand() + { + var command = new Command("effect"); + command.Description = "Provides operations to call the effect method."; + var builder = new EffectRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the eoMonth method. + /// + /// A + public Command BuildEoMonthNavCommand() + { + var command = new Command("eo-month"); + command.Description = "Provides operations to call the eoMonth method."; + var builder = new EoMonthRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the erf_Precise method. + /// + /// A + public Command BuildErf_PreciseNavCommand() + { + var command = new Command("erf_-precise"); + command.Description = "Provides operations to call the erf_Precise method."; + var builder = new Erf_PreciseRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the erfC_Precise method. + /// + /// A + public Command BuildErfC_PreciseNavCommand() + { + var command = new Command("erf-c_-precise"); + command.Description = "Provides operations to call the erfC_Precise method."; + var builder = new ErfC_PreciseRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the erfC method. + /// + /// A + public Command BuildErfCNavCommand() + { + var command = new Command("erf-c"); + command.Description = "Provides operations to call the erfC method."; + var builder = new ErfCRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the erf method. + /// + /// A + public Command BuildErfNavCommand() + { + var command = new Command("erf"); + command.Description = "Provides operations to call the erf method."; + var builder = new ErfRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the error_Type method. + /// + /// A + public Command BuildError_TypeNavCommand() + { + var command = new Command("error_-type"); + command.Description = "Provides operations to call the error_Type method."; + var builder = new Error_TypeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the even method. + /// + /// A + public Command BuildEvenNavCommand() + { + var command = new Command("even"); + command.Description = "Provides operations to call the even method."; + var builder = new EvenRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the exact method. + /// + /// A + public Command BuildExactNavCommand() + { + var command = new Command("exact"); + command.Description = "Provides operations to call the exact method."; + var builder = new ExactRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the exp method. + /// + /// A + public Command BuildExpNavCommand() + { + var command = new Command("exp"); + command.Description = "Provides operations to call the exp method."; + var builder = new ExpRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the expon_Dist method. + /// + /// A + public Command BuildExpon_DistNavCommand() + { + var command = new Command("expon_-dist"); + command.Description = "Provides operations to call the expon_Dist method."; + var builder = new Expon_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the f_Dist_RT method. + /// + /// A + public Command BuildF_Dist_RTNavCommand() + { + var command = new Command("f_-dist_-r-t"); + command.Description = "Provides operations to call the f_Dist_RT method."; + var builder = new F_Dist_RTRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the f_Dist method. + /// + /// A + public Command BuildF_DistNavCommand() + { + var command = new Command("f_-dist"); + command.Description = "Provides operations to call the f_Dist method."; + var builder = new F_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the f_Inv_RT method. + /// + /// A + public Command BuildF_Inv_RTNavCommand() + { + var command = new Command("f_-inv_-r-t"); + command.Description = "Provides operations to call the f_Inv_RT method."; + var builder = new F_Inv_RTRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the f_Inv method. + /// + /// A + public Command BuildF_InvNavCommand() + { + var command = new Command("f_-inv"); + command.Description = "Provides operations to call the f_Inv method."; + var builder = new F_InvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the factDouble method. + /// + /// A + public Command BuildFactDoubleNavCommand() + { + var command = new Command("fact-double"); + command.Description = "Provides operations to call the factDouble method."; + var builder = new FactDoubleRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the fact method. + /// + /// A + public Command BuildFactNavCommand() + { + var command = new Command("fact"); + command.Description = "Provides operations to call the fact method."; + var builder = new FactRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the false method. + /// + /// A + public Command BuildFalseNavCommand() + { + var command = new Command("false"); + command.Description = "Provides operations to call the false method."; + var builder = new FalseRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the findB method. + /// + /// A + public Command BuildFindBNavCommand() + { + var command = new Command("find-b"); + command.Description = "Provides operations to call the findB method."; + var builder = new FindBRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the find method. + /// + /// A + public Command BuildFindNavCommand() + { + var command = new Command("find"); + command.Description = "Provides operations to call the find method."; + var builder = new FindRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the fisherInv method. + /// + /// A + public Command BuildFisherInvNavCommand() + { + var command = new Command("fisher-inv"); + command.Description = "Provides operations to call the fisherInv method."; + var builder = new FisherInvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the fisher method. + /// + /// A + public Command BuildFisherNavCommand() + { + var command = new Command("fisher"); + command.Description = "Provides operations to call the fisher method."; + var builder = new FisherRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the fixed method. + /// + /// A + public Command BuildFixedNavCommand() + { + var command = new Command("fixed"); + command.Description = "Provides operations to call the fixed method."; + var builder = new FixedRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the floor_Math method. + /// + /// A + public Command BuildFloor_MathNavCommand() + { + var command = new Command("floor_-math"); + command.Description = "Provides operations to call the floor_Math method."; + var builder = new Floor_MathRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the floor_Precise method. + /// + /// A + public Command BuildFloor_PreciseNavCommand() + { + var command = new Command("floor_-precise"); + command.Description = "Provides operations to call the floor_Precise method."; + var builder = new Floor_PreciseRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the fv method. + /// + /// A + public Command BuildFvNavCommand() + { + var command = new Command("fv"); + command.Description = "Provides operations to call the fv method."; + var builder = new FvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the fvschedule method. + /// + /// A + public Command BuildFvscheduleNavCommand() + { + var command = new Command("fvschedule"); + command.Description = "Provides operations to call the fvschedule method."; + var builder = new FvscheduleRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the gamma_Dist method. + /// + /// A + public Command BuildGamma_DistNavCommand() + { + var command = new Command("gamma_-dist"); + command.Description = "Provides operations to call the gamma_Dist method."; + var builder = new Gamma_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the gamma_Inv method. + /// + /// A + public Command BuildGamma_InvNavCommand() + { + var command = new Command("gamma_-inv"); + command.Description = "Provides operations to call the gamma_Inv method."; + var builder = new Gamma_InvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the gammaLn_Precise method. + /// + /// A + public Command BuildGammaLn_PreciseNavCommand() + { + var command = new Command("gamma-ln_-precise"); + command.Description = "Provides operations to call the gammaLn_Precise method."; + var builder = new GammaLn_PreciseRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the gammaLn method. + /// + /// A + public Command BuildGammaLnNavCommand() + { + var command = new Command("gamma-ln"); + command.Description = "Provides operations to call the gammaLn method."; + var builder = new GammaLnRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the gamma method. + /// + /// A + public Command BuildGammaNavCommand() + { + var command = new Command("gamma"); + command.Description = "Provides operations to call the gamma method."; + var builder = new GammaRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the gauss method. + /// + /// A + public Command BuildGaussNavCommand() + { + var command = new Command("gauss"); + command.Description = "Provides operations to call the gauss method."; + var builder = new GaussRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the gcd method. + /// + /// A + public Command BuildGcdNavCommand() + { + var command = new Command("gcd"); + command.Description = "Provides operations to call the gcd method."; + var builder = new GcdRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the geoMean method. + /// + /// A + public Command BuildGeoMeanNavCommand() + { + var command = new Command("geo-mean"); + command.Description = "Provides operations to call the geoMean method."; + var builder = new GeoMeanRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the geStep method. + /// + /// A + public Command BuildGeStepNavCommand() + { + var command = new Command("ge-step"); + command.Description = "Provides operations to call the geStep method."; + var builder = new GeStepRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Get functions from storage + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get functions from storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the harMean method. + /// + /// A + public Command BuildHarMeanNavCommand() + { + var command = new Command("har-mean"); + command.Description = "Provides operations to call the harMean method."; + var builder = new HarMeanRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the hex2Bin method. + /// + /// A + public Command BuildHex2BinNavCommand() + { + var command = new Command("hex2-bin"); + command.Description = "Provides operations to call the hex2Bin method."; + var builder = new Hex2BinRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the hex2Dec method. + /// + /// A + public Command BuildHex2DecNavCommand() + { + var command = new Command("hex2-dec"); + command.Description = "Provides operations to call the hex2Dec method."; + var builder = new Hex2DecRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the hex2Oct method. + /// + /// A + public Command BuildHex2OctNavCommand() + { + var command = new Command("hex2-oct"); + command.Description = "Provides operations to call the hex2Oct method."; + var builder = new Hex2OctRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the hlookup method. + /// + /// A + public Command BuildHlookupNavCommand() + { + var command = new Command("hlookup"); + command.Description = "Provides operations to call the hlookup method."; + var builder = new HlookupRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the hour method. + /// + /// A + public Command BuildHourNavCommand() + { + var command = new Command("hour"); + command.Description = "Provides operations to call the hour method."; + var builder = new HourRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the hyperlink method. + /// + /// A + public Command BuildHyperlinkNavCommand() + { + var command = new Command("hyperlink"); + command.Description = "Provides operations to call the hyperlink method."; + var builder = new HyperlinkRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the hypGeom_Dist method. + /// + /// A + public Command BuildHypGeom_DistNavCommand() + { + var command = new Command("hyp-geom_-dist"); + command.Description = "Provides operations to call the hypGeom_Dist method."; + var builder = new HypGeom_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the if method. + /// + /// A + public Command BuildIfNavCommand() + { + var command = new Command("if"); + command.Description = "Provides operations to call the if method."; + var builder = new IfRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imAbs method. + /// + /// A + public Command BuildImAbsNavCommand() + { + var command = new Command("im-abs"); + command.Description = "Provides operations to call the imAbs method."; + var builder = new ImAbsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imaginary method. + /// + /// A + public Command BuildImaginaryNavCommand() + { + var command = new Command("imaginary"); + command.Description = "Provides operations to call the imaginary method."; + var builder = new ImaginaryRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imArgument method. + /// + /// A + public Command BuildImArgumentNavCommand() + { + var command = new Command("im-argument"); + command.Description = "Provides operations to call the imArgument method."; + var builder = new ImArgumentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imConjugate method. + /// + /// A + public Command BuildImConjugateNavCommand() + { + var command = new Command("im-conjugate"); + command.Description = "Provides operations to call the imConjugate method."; + var builder = new ImConjugateRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imCosh method. + /// + /// A + public Command BuildImCoshNavCommand() + { + var command = new Command("im-cosh"); + command.Description = "Provides operations to call the imCosh method."; + var builder = new ImCoshRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imCos method. + /// + /// A + public Command BuildImCosNavCommand() + { + var command = new Command("im-cos"); + command.Description = "Provides operations to call the imCos method."; + var builder = new ImCosRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imCot method. + /// + /// A + public Command BuildImCotNavCommand() + { + var command = new Command("im-cot"); + command.Description = "Provides operations to call the imCot method."; + var builder = new ImCotRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imCsch method. + /// + /// A + public Command BuildImCschNavCommand() + { + var command = new Command("im-csch"); + command.Description = "Provides operations to call the imCsch method."; + var builder = new ImCschRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imCsc method. + /// + /// A + public Command BuildImCscNavCommand() + { + var command = new Command("im-csc"); + command.Description = "Provides operations to call the imCsc method."; + var builder = new ImCscRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imDiv method. + /// + /// A + public Command BuildImDivNavCommand() + { + var command = new Command("im-div"); + command.Description = "Provides operations to call the imDiv method."; + var builder = new ImDivRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imExp method. + /// + /// A + public Command BuildImExpNavCommand() + { + var command = new Command("im-exp"); + command.Description = "Provides operations to call the imExp method."; + var builder = new ImExpRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imLn method. + /// + /// A + public Command BuildImLnNavCommand() + { + var command = new Command("im-ln"); + command.Description = "Provides operations to call the imLn method."; + var builder = new ImLnRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imLog10 method. + /// + /// A + public Command BuildImLog10NavCommand() + { + var command = new Command("im-log10"); + command.Description = "Provides operations to call the imLog10 method."; + var builder = new ImLog10RequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imLog2 method. + /// + /// A + public Command BuildImLog2NavCommand() + { + var command = new Command("im-log2"); + command.Description = "Provides operations to call the imLog2 method."; + var builder = new ImLog2RequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imPower method. + /// + /// A + public Command BuildImPowerNavCommand() + { + var command = new Command("im-power"); + command.Description = "Provides operations to call the imPower method."; + var builder = new ImPowerRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imProduct method. + /// + /// A + public Command BuildImProductNavCommand() + { + var command = new Command("im-product"); + command.Description = "Provides operations to call the imProduct method."; + var builder = new ImProductRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imReal method. + /// + /// A + public Command BuildImRealNavCommand() + { + var command = new Command("im-real"); + command.Description = "Provides operations to call the imReal method."; + var builder = new ImRealRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imSech method. + /// + /// A + public Command BuildImSechNavCommand() + { + var command = new Command("im-sech"); + command.Description = "Provides operations to call the imSech method."; + var builder = new ImSechRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imSec method. + /// + /// A + public Command BuildImSecNavCommand() + { + var command = new Command("im-sec"); + command.Description = "Provides operations to call the imSec method."; + var builder = new ImSecRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imSinh method. + /// + /// A + public Command BuildImSinhNavCommand() + { + var command = new Command("im-sinh"); + command.Description = "Provides operations to call the imSinh method."; + var builder = new ImSinhRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imSin method. + /// + /// A + public Command BuildImSinNavCommand() + { + var command = new Command("im-sin"); + command.Description = "Provides operations to call the imSin method."; + var builder = new ImSinRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imSqrt method. + /// + /// A + public Command BuildImSqrtNavCommand() + { + var command = new Command("im-sqrt"); + command.Description = "Provides operations to call the imSqrt method."; + var builder = new ImSqrtRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imSub method. + /// + /// A + public Command BuildImSubNavCommand() + { + var command = new Command("im-sub"); + command.Description = "Provides operations to call the imSub method."; + var builder = new ImSubRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imSum method. + /// + /// A + public Command BuildImSumNavCommand() + { + var command = new Command("im-sum"); + command.Description = "Provides operations to call the imSum method."; + var builder = new ImSumRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the imTan method. + /// + /// A + public Command BuildImTanNavCommand() + { + var command = new Command("im-tan"); + command.Description = "Provides operations to call the imTan method."; + var builder = new ImTanRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the int method. + /// + /// A + public Command BuildIntNavCommand() + { + var command = new Command("int"); + command.Description = "Provides operations to call the int method."; + var builder = new IntRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the intRate method. + /// + /// A + public Command BuildIntRateNavCommand() + { + var command = new Command("int-rate"); + command.Description = "Provides operations to call the intRate method."; + var builder = new IntRateRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the ipmt method. + /// + /// A + public Command BuildIpmtNavCommand() + { + var command = new Command("ipmt"); + command.Description = "Provides operations to call the ipmt method."; + var builder = new IpmtRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the irr method. + /// + /// A + public Command BuildIrrNavCommand() + { + var command = new Command("irr"); + command.Description = "Provides operations to call the irr method."; + var builder = new IrrRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isErr method. + /// + /// A + public Command BuildIsErrNavCommand() + { + var command = new Command("is-err"); + command.Description = "Provides operations to call the isErr method."; + var builder = new IsErrRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isError method. + /// + /// A + public Command BuildIsErrorNavCommand() + { + var command = new Command("is-error"); + command.Description = "Provides operations to call the isError method."; + var builder = new IsErrorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isEven method. + /// + /// A + public Command BuildIsEvenNavCommand() + { + var command = new Command("is-even"); + command.Description = "Provides operations to call the isEven method."; + var builder = new IsEvenRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isFormula method. + /// + /// A + public Command BuildIsFormulaNavCommand() + { + var command = new Command("is-formula"); + command.Description = "Provides operations to call the isFormula method."; + var builder = new IsFormulaRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isLogical method. + /// + /// A + public Command BuildIsLogicalNavCommand() + { + var command = new Command("is-logical"); + command.Description = "Provides operations to call the isLogical method."; + var builder = new IsLogicalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isNA method. + /// + /// A + public Command BuildIsNANavCommand() + { + var command = new Command("is-n-a"); + command.Description = "Provides operations to call the isNA method."; + var builder = new IsNARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isNonText method. + /// + /// A + public Command BuildIsNonTextNavCommand() + { + var command = new Command("is-non-text"); + command.Description = "Provides operations to call the isNonText method."; + var builder = new IsNonTextRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isNumber method. + /// + /// A + public Command BuildIsNumberNavCommand() + { + var command = new Command("is-number"); + command.Description = "Provides operations to call the isNumber method."; + var builder = new IsNumberRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the iso_Ceiling method. + /// + /// A + public Command BuildIso_CeilingNavCommand() + { + var command = new Command("iso_-ceiling"); + command.Description = "Provides operations to call the iso_Ceiling method."; + var builder = new Iso_CeilingRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isOdd method. + /// + /// A + public Command BuildIsOddNavCommand() + { + var command = new Command("is-odd"); + command.Description = "Provides operations to call the isOdd method."; + var builder = new IsOddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isoWeekNum method. + /// + /// A + public Command BuildIsoWeekNumNavCommand() + { + var command = new Command("iso-week-num"); + command.Description = "Provides operations to call the isoWeekNum method."; + var builder = new IsoWeekNumRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the ispmt method. + /// + /// A + public Command BuildIspmtNavCommand() + { + var command = new Command("ispmt"); + command.Description = "Provides operations to call the ispmt method."; + var builder = new IspmtRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isref method. + /// + /// A + public Command BuildIsrefNavCommand() + { + var command = new Command("isref"); + command.Description = "Provides operations to call the isref method."; + var builder = new IsrefRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the isText method. + /// + /// A + public Command BuildIsTextNavCommand() + { + var command = new Command("is-text"); + command.Description = "Provides operations to call the isText method."; + var builder = new IsTextRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the kurt method. + /// + /// A + public Command BuildKurtNavCommand() + { + var command = new Command("kurt"); + command.Description = "Provides operations to call the kurt method."; + var builder = new KurtRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the large method. + /// + /// A + public Command BuildLargeNavCommand() + { + var command = new Command("large"); + command.Description = "Provides operations to call the large method."; + var builder = new LargeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the lcm method. + /// + /// A + public Command BuildLcmNavCommand() + { + var command = new Command("lcm"); + command.Description = "Provides operations to call the lcm method."; + var builder = new LcmRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the leftb method. + /// + /// A + public Command BuildLeftbNavCommand() + { + var command = new Command("leftb"); + command.Description = "Provides operations to call the leftb method."; + var builder = new LeftbRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the left method. + /// + /// A + public Command BuildLeftNavCommand() + { + var command = new Command("left"); + command.Description = "Provides operations to call the left method."; + var builder = new LeftRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the lenb method. + /// + /// A + public Command BuildLenbNavCommand() + { + var command = new Command("lenb"); + command.Description = "Provides operations to call the lenb method."; + var builder = new LenbRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the len method. + /// + /// A + public Command BuildLenNavCommand() + { + var command = new Command("len"); + command.Description = "Provides operations to call the len method."; + var builder = new LenRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the ln method. + /// + /// A + public Command BuildLnNavCommand() + { + var command = new Command("ln"); + command.Description = "Provides operations to call the ln method."; + var builder = new LnRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the log10 method. + /// + /// A + public Command BuildLog10NavCommand() + { + var command = new Command("log10"); + command.Description = "Provides operations to call the log10 method."; + var builder = new Log10RequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the log method. + /// + /// A + public Command BuildLogNavCommand() + { + var command = new Command("log"); + command.Description = "Provides operations to call the log method."; + var builder = new LogRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the logNorm_Dist method. + /// + /// A + public Command BuildLogNorm_DistNavCommand() + { + var command = new Command("log-norm_-dist"); + command.Description = "Provides operations to call the logNorm_Dist method."; + var builder = new LogNorm_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the logNorm_Inv method. + /// + /// A + public Command BuildLogNorm_InvNavCommand() + { + var command = new Command("log-norm_-inv"); + command.Description = "Provides operations to call the logNorm_Inv method."; + var builder = new LogNorm_InvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the lookup method. + /// + /// A + public Command BuildLookupNavCommand() + { + var command = new Command("lookup"); + command.Description = "Provides operations to call the lookup method."; + var builder = new LookupRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the lower method. + /// + /// A + public Command BuildLowerNavCommand() + { + var command = new Command("lower"); + command.Description = "Provides operations to call the lower method."; + var builder = new LowerRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the match method. + /// + /// A + public Command BuildMatchNavCommand() + { + var command = new Command("match"); + command.Description = "Provides operations to call the match method."; + var builder = new MatchRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the maxA method. + /// + /// A + public Command BuildMaxANavCommand() + { + var command = new Command("max-a"); + command.Description = "Provides operations to call the maxA method."; + var builder = new MaxARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the max method. + /// + /// A + public Command BuildMaxNavCommand() + { + var command = new Command("max"); + command.Description = "Provides operations to call the max method."; + var builder = new MaxRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the mduration method. + /// + /// A + public Command BuildMdurationNavCommand() + { + var command = new Command("mduration"); + command.Description = "Provides operations to call the mduration method."; + var builder = new MdurationRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the median method. + /// + /// A + public Command BuildMedianNavCommand() + { + var command = new Command("median"); + command.Description = "Provides operations to call the median method."; + var builder = new MedianRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the midb method. + /// + /// A + public Command BuildMidbNavCommand() + { + var command = new Command("midb"); + command.Description = "Provides operations to call the midb method."; + var builder = new MidbRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the mid method. + /// + /// A + public Command BuildMidNavCommand() + { + var command = new Command("mid"); + command.Description = "Provides operations to call the mid method."; + var builder = new MidRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the minA method. + /// + /// A + public Command BuildMinANavCommand() + { + var command = new Command("min-a"); + command.Description = "Provides operations to call the minA method."; + var builder = new MinARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the min method. + /// + /// A + public Command BuildMinNavCommand() + { + var command = new Command("min"); + command.Description = "Provides operations to call the min method."; + var builder = new MinRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the minute method. + /// + /// A + public Command BuildMinuteNavCommand() + { + var command = new Command("minute"); + command.Description = "Provides operations to call the minute method."; + var builder = new MinuteRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the mirr method. + /// + /// A + public Command BuildMirrNavCommand() + { + var command = new Command("mirr"); + command.Description = "Provides operations to call the mirr method."; + var builder = new MirrRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the mod method. + /// + /// A + public Command BuildModNavCommand() + { + var command = new Command("mod"); + command.Description = "Provides operations to call the mod method."; + var builder = new ModRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the month method. + /// + /// A + public Command BuildMonthNavCommand() + { + var command = new Command("month"); + command.Description = "Provides operations to call the month method."; + var builder = new MonthRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the mround method. + /// + /// A + public Command BuildMroundNavCommand() + { + var command = new Command("mround"); + command.Description = "Provides operations to call the mround method."; + var builder = new MroundRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the multiNomial method. + /// + /// A + public Command BuildMultiNomialNavCommand() + { + var command = new Command("multi-nomial"); + command.Description = "Provides operations to call the multiNomial method."; + var builder = new MultiNomialRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the na method. + /// + /// A + public Command BuildNaNavCommand() + { + var command = new Command("na"); + command.Description = "Provides operations to call the na method."; + var builder = new NaRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the negBinom_Dist method. + /// + /// A + public Command BuildNegBinom_DistNavCommand() + { + var command = new Command("neg-binom_-dist"); + command.Description = "Provides operations to call the negBinom_Dist method."; + var builder = new NegBinom_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the networkDays_Intl method. + /// + /// A + public Command BuildNetworkDays_IntlNavCommand() + { + var command = new Command("network-days_-intl"); + command.Description = "Provides operations to call the networkDays_Intl method."; + var builder = new NetworkDays_IntlRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the networkDays method. + /// + /// A + public Command BuildNetworkDaysNavCommand() + { + var command = new Command("network-days"); + command.Description = "Provides operations to call the networkDays method."; + var builder = new NetworkDaysRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the n method. + /// + /// A + public Command BuildNNavCommand() + { + var command = new Command("n"); + command.Description = "Provides operations to call the n method."; + var builder = new NRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the nominal method. + /// + /// A + public Command BuildNominalNavCommand() + { + var command = new Command("nominal"); + command.Description = "Provides operations to call the nominal method."; + var builder = new NominalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the norm_Dist method. + /// + /// A + public Command BuildNorm_DistNavCommand() + { + var command = new Command("norm_-dist"); + command.Description = "Provides operations to call the norm_Dist method."; + var builder = new Norm_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the norm_Inv method. + /// + /// A + public Command BuildNorm_InvNavCommand() + { + var command = new Command("norm_-inv"); + command.Description = "Provides operations to call the norm_Inv method."; + var builder = new Norm_InvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the norm_S_Dist method. + /// + /// A + public Command BuildNorm_S_DistNavCommand() + { + var command = new Command("norm_-s_-dist"); + command.Description = "Provides operations to call the norm_S_Dist method."; + var builder = new Norm_S_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the norm_S_Inv method. + /// + /// A + public Command BuildNorm_S_InvNavCommand() + { + var command = new Command("norm_-s_-inv"); + command.Description = "Provides operations to call the norm_S_Inv method."; + var builder = new Norm_S_InvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the not method. + /// + /// A + public Command BuildNotNavCommand() + { + var command = new Command("not"); + command.Description = "Provides operations to call the not method."; + var builder = new NotRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the now method. + /// + /// A + public Command BuildNowNavCommand() + { + var command = new Command("now"); + command.Description = "Provides operations to call the now method."; + var builder = new NowRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the nper method. + /// + /// A + public Command BuildNperNavCommand() + { + var command = new Command("nper"); + command.Description = "Provides operations to call the nper method."; + var builder = new NperRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the npv method. + /// + /// A + public Command BuildNpvNavCommand() + { + var command = new Command("npv"); + command.Description = "Provides operations to call the npv method."; + var builder = new NpvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the numberValue method. + /// + /// A + public Command BuildNumberValueNavCommand() + { + var command = new Command("number-value"); + command.Description = "Provides operations to call the numberValue method."; + var builder = new NumberValueRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the oct2Bin method. + /// + /// A + public Command BuildOct2BinNavCommand() + { + var command = new Command("oct2-bin"); + command.Description = "Provides operations to call the oct2Bin method."; + var builder = new Oct2BinRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the oct2Dec method. + /// + /// A + public Command BuildOct2DecNavCommand() + { + var command = new Command("oct2-dec"); + command.Description = "Provides operations to call the oct2Dec method."; + var builder = new Oct2DecRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the oct2Hex method. + /// + /// A + public Command BuildOct2HexNavCommand() + { + var command = new Command("oct2-hex"); + command.Description = "Provides operations to call the oct2Hex method."; + var builder = new Oct2HexRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the oddFPrice method. + /// + /// A + public Command BuildOddFPriceNavCommand() + { + var command = new Command("odd-f-price"); + command.Description = "Provides operations to call the oddFPrice method."; + var builder = new OddFPriceRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the oddFYield method. + /// + /// A + public Command BuildOddFYieldNavCommand() + { + var command = new Command("odd-f-yield"); + command.Description = "Provides operations to call the oddFYield method."; + var builder = new OddFYieldRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the oddLPrice method. + /// + /// A + public Command BuildOddLPriceNavCommand() + { + var command = new Command("odd-l-price"); + command.Description = "Provides operations to call the oddLPrice method."; + var builder = new OddLPriceRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the oddLYield method. + /// + /// A + public Command BuildOddLYieldNavCommand() + { + var command = new Command("odd-l-yield"); + command.Description = "Provides operations to call the oddLYield method."; + var builder = new OddLYieldRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the odd method. + /// + /// A + public Command BuildOddNavCommand() + { + var command = new Command("odd"); + command.Description = "Provides operations to call the odd method."; + var builder = new OddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the or method. + /// + /// A + public Command BuildOrNavCommand() + { + var command = new Command("or"); + command.Description = "Provides operations to call the or method."; + var builder = new OrRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property functions in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property functions in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookFunctions.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the pduration method. + /// + /// A + public Command BuildPdurationNavCommand() + { + var command = new Command("pduration"); + command.Description = "Provides operations to call the pduration method."; + var builder = new PdurationRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the percentile_Exc method. + /// + /// A + public Command BuildPercentile_ExcNavCommand() + { + var command = new Command("percentile_-exc"); + command.Description = "Provides operations to call the percentile_Exc method."; + var builder = new Percentile_ExcRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the percentile_Inc method. + /// + /// A + public Command BuildPercentile_IncNavCommand() + { + var command = new Command("percentile_-inc"); + command.Description = "Provides operations to call the percentile_Inc method."; + var builder = new Percentile_IncRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the percentRank_Exc method. + /// + /// A + public Command BuildPercentRank_ExcNavCommand() + { + var command = new Command("percent-rank_-exc"); + command.Description = "Provides operations to call the percentRank_Exc method."; + var builder = new PercentRank_ExcRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the percentRank_Inc method. + /// + /// A + public Command BuildPercentRank_IncNavCommand() + { + var command = new Command("percent-rank_-inc"); + command.Description = "Provides operations to call the percentRank_Inc method."; + var builder = new PercentRank_IncRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the permutationa method. + /// + /// A + public Command BuildPermutationaNavCommand() + { + var command = new Command("permutationa"); + command.Description = "Provides operations to call the permutationa method."; + var builder = new PermutationaRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the permut method. + /// + /// A + public Command BuildPermutNavCommand() + { + var command = new Command("permut"); + command.Description = "Provides operations to call the permut method."; + var builder = new PermutRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the phi method. + /// + /// A + public Command BuildPhiNavCommand() + { + var command = new Command("phi"); + command.Description = "Provides operations to call the phi method."; + var builder = new PhiRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the pi method. + /// + /// A + public Command BuildPiNavCommand() + { + var command = new Command("pi"); + command.Description = "Provides operations to call the pi method."; + var builder = new PiRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the pmt method. + /// + /// A + public Command BuildPmtNavCommand() + { + var command = new Command("pmt"); + command.Description = "Provides operations to call the pmt method."; + var builder = new PmtRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the poisson_Dist method. + /// + /// A + public Command BuildPoisson_DistNavCommand() + { + var command = new Command("poisson_-dist"); + command.Description = "Provides operations to call the poisson_Dist method."; + var builder = new Poisson_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the power method. + /// + /// A + public Command BuildPowerNavCommand() + { + var command = new Command("power"); + command.Description = "Provides operations to call the power method."; + var builder = new PowerRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the ppmt method. + /// + /// A + public Command BuildPpmtNavCommand() + { + var command = new Command("ppmt"); + command.Description = "Provides operations to call the ppmt method."; + var builder = new PpmtRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the priceDisc method. + /// + /// A + public Command BuildPriceDiscNavCommand() + { + var command = new Command("price-disc"); + command.Description = "Provides operations to call the priceDisc method."; + var builder = new PriceDiscRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the priceMat method. + /// + /// A + public Command BuildPriceMatNavCommand() + { + var command = new Command("price-mat"); + command.Description = "Provides operations to call the priceMat method."; + var builder = new PriceMatRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the price method. + /// + /// A + public Command BuildPriceNavCommand() + { + var command = new Command("price"); + command.Description = "Provides operations to call the price method."; + var builder = new PriceRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the product method. + /// + /// A + public Command BuildProductNavCommand() + { + var command = new Command("product"); + command.Description = "Provides operations to call the product method."; + var builder = new ProductRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the proper method. + /// + /// A + public Command BuildProperNavCommand() + { + var command = new Command("proper"); + command.Description = "Provides operations to call the proper method."; + var builder = new ProperRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the pv method. + /// + /// A + public Command BuildPvNavCommand() + { + var command = new Command("pv"); + command.Description = "Provides operations to call the pv method."; + var builder = new PvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the quartile_Exc method. + /// + /// A + public Command BuildQuartile_ExcNavCommand() + { + var command = new Command("quartile_-exc"); + command.Description = "Provides operations to call the quartile_Exc method."; + var builder = new Quartile_ExcRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the quartile_Inc method. + /// + /// A + public Command BuildQuartile_IncNavCommand() + { + var command = new Command("quartile_-inc"); + command.Description = "Provides operations to call the quartile_Inc method."; + var builder = new Quartile_IncRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the quotient method. + /// + /// A + public Command BuildQuotientNavCommand() + { + var command = new Command("quotient"); + command.Description = "Provides operations to call the quotient method."; + var builder = new QuotientRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the radians method. + /// + /// A + public Command BuildRadiansNavCommand() + { + var command = new Command("radians"); + command.Description = "Provides operations to call the radians method."; + var builder = new RadiansRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the randBetween method. + /// + /// A + public Command BuildRandBetweenNavCommand() + { + var command = new Command("rand-between"); + command.Description = "Provides operations to call the randBetween method."; + var builder = new RandBetweenRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the rand method. + /// + /// A + public Command BuildRandNavCommand() + { + var command = new Command("rand"); + command.Description = "Provides operations to call the rand method."; + var builder = new RandRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the rank_Avg method. + /// + /// A + public Command BuildRank_AvgNavCommand() + { + var command = new Command("rank_-avg"); + command.Description = "Provides operations to call the rank_Avg method."; + var builder = new Rank_AvgRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the rank_Eq method. + /// + /// A + public Command BuildRank_EqNavCommand() + { + var command = new Command("rank_-eq"); + command.Description = "Provides operations to call the rank_Eq method."; + var builder = new Rank_EqRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the rate method. + /// + /// A + public Command BuildRateNavCommand() + { + var command = new Command("rate"); + command.Description = "Provides operations to call the rate method."; + var builder = new RateRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the received method. + /// + /// A + public Command BuildReceivedNavCommand() + { + var command = new Command("received"); + command.Description = "Provides operations to call the received method."; + var builder = new ReceivedRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the replaceB method. + /// + /// A + public Command BuildReplaceBNavCommand() + { + var command = new Command("replace-b"); + command.Description = "Provides operations to call the replaceB method."; + var builder = new ReplaceBRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the replace method. + /// + /// A + public Command BuildReplaceNavCommand() + { + var command = new Command("replace"); + command.Description = "Provides operations to call the replace method."; + var builder = new ReplaceRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the rept method. + /// + /// A + public Command BuildReptNavCommand() + { + var command = new Command("rept"); + command.Description = "Provides operations to call the rept method."; + var builder = new ReptRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the rightb method. + /// + /// A + public Command BuildRightbNavCommand() + { + var command = new Command("rightb"); + command.Description = "Provides operations to call the rightb method."; + var builder = new RightbRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the right method. + /// + /// A + public Command BuildRightNavCommand() + { + var command = new Command("right"); + command.Description = "Provides operations to call the right method."; + var builder = new RightRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the roman method. + /// + /// A + public Command BuildRomanNavCommand() + { + var command = new Command("roman"); + command.Description = "Provides operations to call the roman method."; + var builder = new RomanRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the roundDown method. + /// + /// A + public Command BuildRoundDownNavCommand() + { + var command = new Command("round-down"); + command.Description = "Provides operations to call the roundDown method."; + var builder = new RoundDownRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the round method. + /// + /// A + public Command BuildRoundNavCommand() + { + var command = new Command("round"); + command.Description = "Provides operations to call the round method."; + var builder = new RoundRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the roundUp method. + /// + /// A + public Command BuildRoundUpNavCommand() + { + var command = new Command("round-up"); + command.Description = "Provides operations to call the roundUp method."; + var builder = new RoundUpRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the rows method. + /// + /// A + public Command BuildRowsNavCommand() + { + var command = new Command("rows"); + command.Description = "Provides operations to call the rows method."; + var builder = new RowsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the rri method. + /// + /// A + public Command BuildRriNavCommand() + { + var command = new Command("rri"); + command.Description = "Provides operations to call the rri method."; + var builder = new RriRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sech method. + /// + /// A + public Command BuildSechNavCommand() + { + var command = new Command("sech"); + command.Description = "Provides operations to call the sech method."; + var builder = new SechRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sec method. + /// + /// A + public Command BuildSecNavCommand() + { + var command = new Command("sec"); + command.Description = "Provides operations to call the sec method."; + var builder = new SecRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the second method. + /// + /// A + public Command BuildSecondNavCommand() + { + var command = new Command("second"); + command.Description = "Provides operations to call the second method."; + var builder = new SecondRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the seriesSum method. + /// + /// A + public Command BuildSeriesSumNavCommand() + { + var command = new Command("series-sum"); + command.Description = "Provides operations to call the seriesSum method."; + var builder = new SeriesSumRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sheet method. + /// + /// A + public Command BuildSheetNavCommand() + { + var command = new Command("sheet"); + command.Description = "Provides operations to call the sheet method."; + var builder = new SheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sheets method. + /// + /// A + public Command BuildSheetsNavCommand() + { + var command = new Command("sheets"); + command.Description = "Provides operations to call the sheets method."; + var builder = new SheetsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sign method. + /// + /// A + public Command BuildSignNavCommand() + { + var command = new Command("sign"); + command.Description = "Provides operations to call the sign method."; + var builder = new SignRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sinh method. + /// + /// A + public Command BuildSinhNavCommand() + { + var command = new Command("sinh"); + command.Description = "Provides operations to call the sinh method."; + var builder = new SinhRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sin method. + /// + /// A + public Command BuildSinNavCommand() + { + var command = new Command("sin"); + command.Description = "Provides operations to call the sin method."; + var builder = new SinRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the skew_p method. + /// + /// A + public Command BuildSkew_pNavCommand() + { + var command = new Command("skew_p"); + command.Description = "Provides operations to call the skew_p method."; + var builder = new Skew_pRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the skew method. + /// + /// A + public Command BuildSkewNavCommand() + { + var command = new Command("skew"); + command.Description = "Provides operations to call the skew method."; + var builder = new SkewRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sln method. + /// + /// A + public Command BuildSlnNavCommand() + { + var command = new Command("sln"); + command.Description = "Provides operations to call the sln method."; + var builder = new SlnRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the small method. + /// + /// A + public Command BuildSmallNavCommand() + { + var command = new Command("small"); + command.Description = "Provides operations to call the small method."; + var builder = new SmallRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sqrt method. + /// + /// A + public Command BuildSqrtNavCommand() + { + var command = new Command("sqrt"); + command.Description = "Provides operations to call the sqrt method."; + var builder = new SqrtRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sqrtPi method. + /// + /// A + public Command BuildSqrtPiNavCommand() + { + var command = new Command("sqrt-pi"); + command.Description = "Provides operations to call the sqrtPi method."; + var builder = new SqrtPiRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the standardize method. + /// + /// A + public Command BuildStandardizeNavCommand() + { + var command = new Command("standardize"); + command.Description = "Provides operations to call the standardize method."; + var builder = new StandardizeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the stDev_P method. + /// + /// A + public Command BuildStDev_PNavCommand() + { + var command = new Command("st-dev_-p"); + command.Description = "Provides operations to call the stDev_P method."; + var builder = new StDev_PRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the stDev_S method. + /// + /// A + public Command BuildStDev_SNavCommand() + { + var command = new Command("st-dev_-s"); + command.Description = "Provides operations to call the stDev_S method."; + var builder = new StDev_SRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the stDevA method. + /// + /// A + public Command BuildStDevANavCommand() + { + var command = new Command("st-dev-a"); + command.Description = "Provides operations to call the stDevA method."; + var builder = new StDevARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the stDevPA method. + /// + /// A + public Command BuildStDevPANavCommand() + { + var command = new Command("st-dev-p-a"); + command.Description = "Provides operations to call the stDevPA method."; + var builder = new StDevPARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the substitute method. + /// + /// A + public Command BuildSubstituteNavCommand() + { + var command = new Command("substitute"); + command.Description = "Provides operations to call the substitute method."; + var builder = new SubstituteRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the subtotal method. + /// + /// A + public Command BuildSubtotalNavCommand() + { + var command = new Command("subtotal"); + command.Description = "Provides operations to call the subtotal method."; + var builder = new SubtotalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sumIf method. + /// + /// A + public Command BuildSumIfNavCommand() + { + var command = new Command("sum-if"); + command.Description = "Provides operations to call the sumIf method."; + var builder = new SumIfRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sumIfs method. + /// + /// A + public Command BuildSumIfsNavCommand() + { + var command = new Command("sum-ifs"); + command.Description = "Provides operations to call the sumIfs method."; + var builder = new SumIfsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sum method. + /// + /// A + public Command BuildSumNavCommand() + { + var command = new Command("sum"); + command.Description = "Provides operations to call the sum method."; + var builder = new SumRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sumSq method. + /// + /// A + public Command BuildSumSqNavCommand() + { + var command = new Command("sum-sq"); + command.Description = "Provides operations to call the sumSq method."; + var builder = new SumSqRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the syd method. + /// + /// A + public Command BuildSydNavCommand() + { + var command = new Command("syd"); + command.Description = "Provides operations to call the syd method."; + var builder = new SydRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the t_Dist_2T method. + /// + /// A + public Command BuildT_Dist_2TNavCommand() + { + var command = new Command("t_-dist_2-t"); + command.Description = "Provides operations to call the t_Dist_2T method."; + var builder = new T_Dist_2TRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the t_Dist_RT method. + /// + /// A + public Command BuildT_Dist_RTNavCommand() + { + var command = new Command("t_-dist_-r-t"); + command.Description = "Provides operations to call the t_Dist_RT method."; + var builder = new T_Dist_RTRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the t_Dist method. + /// + /// A + public Command BuildT_DistNavCommand() + { + var command = new Command("t_-dist"); + command.Description = "Provides operations to call the t_Dist method."; + var builder = new T_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the t_Inv_2T method. + /// + /// A + public Command BuildT_Inv_2TNavCommand() + { + var command = new Command("t_-inv_2-t"); + command.Description = "Provides operations to call the t_Inv_2T method."; + var builder = new T_Inv_2TRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the t_Inv method. + /// + /// A + public Command BuildT_InvNavCommand() + { + var command = new Command("t_-inv"); + command.Description = "Provides operations to call the t_Inv method."; + var builder = new T_InvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the tanh method. + /// + /// A + public Command BuildTanhNavCommand() + { + var command = new Command("tanh"); + command.Description = "Provides operations to call the tanh method."; + var builder = new TanhRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the tan method. + /// + /// A + public Command BuildTanNavCommand() + { + var command = new Command("tan"); + command.Description = "Provides operations to call the tan method."; + var builder = new TanRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the tbillEq method. + /// + /// A + public Command BuildTbillEqNavCommand() + { + var command = new Command("tbill-eq"); + command.Description = "Provides operations to call the tbillEq method."; + var builder = new TbillEqRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the tbillPrice method. + /// + /// A + public Command BuildTbillPriceNavCommand() + { + var command = new Command("tbill-price"); + command.Description = "Provides operations to call the tbillPrice method."; + var builder = new TbillPriceRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the tbillYield method. + /// + /// A + public Command BuildTbillYieldNavCommand() + { + var command = new Command("tbill-yield"); + command.Description = "Provides operations to call the tbillYield method."; + var builder = new TbillYieldRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the text method. + /// + /// A + public Command BuildTextNavCommand() + { + var command = new Command("text"); + command.Description = "Provides operations to call the text method."; + var builder = new TextRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the time method. + /// + /// A + public Command BuildTimeNavCommand() + { + var command = new Command("time"); + command.Description = "Provides operations to call the time method."; + var builder = new TimeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the timevalue method. + /// + /// A + public Command BuildTimevalueNavCommand() + { + var command = new Command("timevalue"); + command.Description = "Provides operations to call the timevalue method."; + var builder = new TimevalueRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the t method. + /// + /// A + public Command BuildTNavCommand() + { + var command = new Command("t"); + command.Description = "Provides operations to call the t method."; + var builder = new TRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the today method. + /// + /// A + public Command BuildTodayNavCommand() + { + var command = new Command("today"); + command.Description = "Provides operations to call the today method."; + var builder = new TodayRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the trimMean method. + /// + /// A + public Command BuildTrimMeanNavCommand() + { + var command = new Command("trim-mean"); + command.Description = "Provides operations to call the trimMean method."; + var builder = new TrimMeanRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the trim method. + /// + /// A + public Command BuildTrimNavCommand() + { + var command = new Command("trim"); + command.Description = "Provides operations to call the trim method."; + var builder = new TrimRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the true method. + /// + /// A + public Command BuildTrueNavCommand() + { + var command = new Command("true"); + command.Description = "Provides operations to call the true method."; + var builder = new TrueRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the trunc method. + /// + /// A + public Command BuildTruncNavCommand() + { + var command = new Command("trunc"); + command.Description = "Provides operations to call the trunc method."; + var builder = new TruncRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the type method. + /// + /// A + public Command BuildTypeNavCommand() + { + var command = new Command("type"); + command.Description = "Provides operations to call the type method."; + var builder = new TypeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the unichar method. + /// + /// A + public Command BuildUnicharNavCommand() + { + var command = new Command("unichar"); + command.Description = "Provides operations to call the unichar method."; + var builder = new UnicharRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the unicode method. + /// + /// A + public Command BuildUnicodeNavCommand() + { + var command = new Command("unicode"); + command.Description = "Provides operations to call the unicode method."; + var builder = new UnicodeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the upper method. + /// + /// A + public Command BuildUpperNavCommand() + { + var command = new Command("upper"); + command.Description = "Provides operations to call the upper method."; + var builder = new UpperRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the usdollar method. + /// + /// A + public Command BuildUsdollarNavCommand() + { + var command = new Command("usdollar"); + command.Description = "Provides operations to call the usdollar method."; + var builder = new UsdollarRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the value method. + /// + /// A + public Command BuildValueNavCommand() + { + var command = new Command("value"); + command.Description = "Provides operations to call the value method."; + var builder = new ValueRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the var_P method. + /// + /// A + public Command BuildVar_PNavCommand() + { + var command = new Command("var_-p"); + command.Description = "Provides operations to call the var_P method."; + var builder = new Var_PRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the var_S method. + /// + /// A + public Command BuildVar_SNavCommand() + { + var command = new Command("var_-s"); + command.Description = "Provides operations to call the var_S method."; + var builder = new Var_SRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the varA method. + /// + /// A + public Command BuildVarANavCommand() + { + var command = new Command("var-a"); + command.Description = "Provides operations to call the varA method."; + var builder = new VarARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the varPA method. + /// + /// A + public Command BuildVarPANavCommand() + { + var command = new Command("var-p-a"); + command.Description = "Provides operations to call the varPA method."; + var builder = new VarPARequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the vdb method. + /// + /// A + public Command BuildVdbNavCommand() + { + var command = new Command("vdb"); + command.Description = "Provides operations to call the vdb method."; + var builder = new VdbRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the vlookup method. + /// + /// A + public Command BuildVlookupNavCommand() + { + var command = new Command("vlookup"); + command.Description = "Provides operations to call the vlookup method."; + var builder = new VlookupRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the weekday method. + /// + /// A + public Command BuildWeekdayNavCommand() + { + var command = new Command("weekday"); + command.Description = "Provides operations to call the weekday method."; + var builder = new WeekdayRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the weekNum method. + /// + /// A + public Command BuildWeekNumNavCommand() + { + var command = new Command("week-num"); + command.Description = "Provides operations to call the weekNum method."; + var builder = new WeekNumRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the weibull_Dist method. + /// + /// A + public Command BuildWeibull_DistNavCommand() + { + var command = new Command("weibull_-dist"); + command.Description = "Provides operations to call the weibull_Dist method."; + var builder = new Weibull_DistRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the workDay_Intl method. + /// + /// A + public Command BuildWorkDay_IntlNavCommand() + { + var command = new Command("work-day_-intl"); + command.Description = "Provides operations to call the workDay_Intl method."; + var builder = new WorkDay_IntlRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the workDay method. + /// + /// A + public Command BuildWorkDayNavCommand() + { + var command = new Command("work-day"); + command.Description = "Provides operations to call the workDay method."; + var builder = new WorkDayRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the xirr method. + /// + /// A + public Command BuildXirrNavCommand() + { + var command = new Command("xirr"); + command.Description = "Provides operations to call the xirr method."; + var builder = new XirrRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the xnpv method. + /// + /// A + public Command BuildXnpvNavCommand() + { + var command = new Command("xnpv"); + command.Description = "Provides operations to call the xnpv method."; + var builder = new XnpvRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the xor method. + /// + /// A + public Command BuildXorNavCommand() + { + var command = new Command("xor"); + command.Description = "Provides operations to call the xor method."; + var builder = new XorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the yearFrac method. + /// + /// A + public Command BuildYearFracNavCommand() + { + var command = new Command("year-frac"); + command.Description = "Provides operations to call the yearFrac method."; + var builder = new YearFracRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the year method. + /// + /// A + public Command BuildYearNavCommand() + { + var command = new Command("year"); + command.Description = "Provides operations to call the year method."; + var builder = new YearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the yieldDisc method. + /// + /// A + public Command BuildYieldDiscNavCommand() + { + var command = new Command("yield-disc"); + command.Description = "Provides operations to call the yieldDisc method."; + var builder = new YieldDiscRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the yieldMat method. + /// + /// A + public Command BuildYieldMatNavCommand() + { + var command = new Command("yield-mat"); + command.Description = "Provides operations to call the yieldMat method."; + var builder = new YieldMatRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the yield method. + /// + /// A + public Command BuildYieldNavCommand() + { + var command = new Command("yield"); + command.Description = "Provides operations to call the yield method."; + var builder = new YieldRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the z_Test method. + /// + /// A + public Command BuildZ_TestNavCommand() + { + var command = new Command("z_-test"); + command.Description = "Provides operations to call the z_Test method."; + var builder = new Z_TestRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FunctionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FunctionsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property functions for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get functions from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property functions in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookFunctions body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookFunctions body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get functions from storage + /// + public class FunctionsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fv/FvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fv/FvPostRequestBody.cs new file mode 100644 index 0000000000..d8183a341b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fv/FvPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fv +{ + #pragma warning disable CS1591 + public class FvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The pmt property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pmt { get; set; } +#nullable restore +#else + public Json Pmt { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Type { get; set; } +#nullable restore +#else + public Json Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pmt", n => { Pmt = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("pmt", Pmt); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fv/FvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fv/FvRequestBuilder.cs new file mode 100644 index 0000000000..c2f2a9e4ac --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fv/FvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fv +{ + /// + /// Provides operations to call the fv method. + /// + public class FvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action fv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action fv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fv", rawUrl) + { + } + /// + /// Invoke action fv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fvschedule/FvschedulePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fvschedule/FvschedulePostRequestBody.cs new file mode 100644 index 0000000000..c95eded43f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fvschedule/FvschedulePostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fvschedule +{ + #pragma warning disable CS1591 + public class FvschedulePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The principal property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Principal { get; set; } +#nullable restore +#else + public Json Principal { get; set; } +#endif + /// The schedule property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Schedule { get; set; } +#nullable restore +#else + public Json Schedule { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public FvschedulePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static FvschedulePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FvschedulePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "principal", n => { Principal = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "schedule", n => { Schedule = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("principal", Principal); + writer.WriteObjectValue("schedule", Schedule); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fvschedule/FvscheduleRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fvschedule/FvscheduleRequestBuilder.cs new file mode 100644 index 0000000000..fb19660e99 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Fvschedule/FvscheduleRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Fvschedule +{ + /// + /// Provides operations to call the fvschedule method. + /// + public class FvscheduleRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action fvschedule + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action fvschedule"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FvschedulePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FvscheduleRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fvschedule", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FvscheduleRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/fvschedule", rawUrl) + { + } + /// + /// Invoke action fvschedule + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(FvschedulePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(FvschedulePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma/GammaPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma/GammaPostRequestBody.cs new file mode 100644 index 0000000000..712a9581ab --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma/GammaPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gamma +{ + #pragma warning disable CS1591 + public class GammaPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GammaPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static GammaPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GammaPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma/GammaRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma/GammaRequestBuilder.cs new file mode 100644 index 0000000000..bcf7ecb5e8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma/GammaRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gamma +{ + /// + /// Provides operations to call the gamma method. + /// + public class GammaRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action gamma + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action gamma"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(GammaPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GammaRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gamma", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GammaRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gamma", rawUrl) + { + } + /// + /// Invoke action gamma + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GammaPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GammaPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn/GammaLnPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn/GammaLnPostRequestBody.cs new file mode 100644 index 0000000000..9d87a297c1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn/GammaLnPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GammaLn +{ + #pragma warning disable CS1591 + public class GammaLnPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GammaLnPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static GammaLnPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GammaLnPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn/GammaLnRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn/GammaLnRequestBuilder.cs new file mode 100644 index 0000000000..d2aaec1fe2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn/GammaLnRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GammaLn +{ + /// + /// Provides operations to call the gammaLn method. + /// + public class GammaLnRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action gammaLn + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action gammaLn"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(GammaLnPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GammaLnRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gammaLn", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GammaLnRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gammaLn", rawUrl) + { + } + /// + /// Invoke action gammaLn + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GammaLnPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GammaLnPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PrecisePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PrecisePostRequestBody.cs new file mode 100644 index 0000000000..1c9b8d68f3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PrecisePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GammaLn_Precise +{ + #pragma warning disable CS1591 + public class GammaLn_PrecisePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GammaLn_PrecisePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static GammaLn_PrecisePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GammaLn_PrecisePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PreciseRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PreciseRequestBuilder.cs new file mode 100644 index 0000000000..2c0558989f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GammaLn_Precise/GammaLn_PreciseRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GammaLn_Precise +{ + /// + /// Provides operations to call the gammaLn_Precise method. + /// + public class GammaLn_PreciseRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action gammaLn_Precise + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action gammaLn_Precise"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(GammaLn_PrecisePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GammaLn_PreciseRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gammaLn_Precise", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GammaLn_PreciseRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gammaLn_Precise", rawUrl) + { + } + /// + /// Invoke action gammaLn_Precise + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GammaLn_PrecisePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GammaLn_PrecisePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Dist/Gamma_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Dist/Gamma_DistPostRequestBody.cs new file mode 100644 index 0000000000..09c19d694c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Dist/Gamma_DistPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gamma_Dist +{ + #pragma warning disable CS1591 + public class Gamma_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alpha property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Alpha { get; set; } +#nullable restore +#else + public Json Alpha { get; set; } +#endif + /// The beta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Beta { get; set; } +#nullable restore +#else + public Json Beta { get; set; } +#endif + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Gamma_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Gamma_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Gamma_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alpha", n => { Alpha = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "beta", n => { Beta = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alpha", Alpha); + writer.WriteObjectValue("beta", Beta); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Dist/Gamma_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Dist/Gamma_DistRequestBuilder.cs new file mode 100644 index 0000000000..0f626aa362 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Dist/Gamma_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gamma_Dist +{ + /// + /// Provides operations to call the gamma_Dist method. + /// + public class Gamma_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action gamma_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action gamma_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Gamma_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Gamma_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gamma_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Gamma_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gamma_Dist", rawUrl) + { + } + /// + /// Invoke action gamma_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Gamma_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Gamma_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Inv/Gamma_InvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Inv/Gamma_InvPostRequestBody.cs new file mode 100644 index 0000000000..369dd6cdf3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Inv/Gamma_InvPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gamma_Inv +{ + #pragma warning disable CS1591 + public class Gamma_InvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alpha property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Alpha { get; set; } +#nullable restore +#else + public Json Alpha { get; set; } +#endif + /// The beta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Beta { get; set; } +#nullable restore +#else + public Json Beta { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Gamma_InvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Gamma_InvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Gamma_InvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alpha", n => { Alpha = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "beta", n => { Beta = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alpha", Alpha); + writer.WriteObjectValue("beta", Beta); + writer.WriteObjectValue("probability", Probability); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Inv/Gamma_InvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Inv/Gamma_InvRequestBuilder.cs new file mode 100644 index 0000000000..3168c7c7d8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gamma_Inv/Gamma_InvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gamma_Inv +{ + /// + /// Provides operations to call the gamma_Inv method. + /// + public class Gamma_InvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action gamma_Inv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action gamma_Inv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Gamma_InvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Gamma_InvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gamma_Inv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Gamma_InvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gamma_Inv", rawUrl) + { + } + /// + /// Invoke action gamma_Inv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Gamma_InvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Gamma_InvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gauss/GaussPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gauss/GaussPostRequestBody.cs new file mode 100644 index 0000000000..efd9619201 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gauss/GaussPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gauss +{ + #pragma warning disable CS1591 + public class GaussPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GaussPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static GaussPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GaussPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gauss/GaussRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gauss/GaussRequestBuilder.cs new file mode 100644 index 0000000000..8d329591ab --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gauss/GaussRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gauss +{ + /// + /// Provides operations to call the gauss method. + /// + public class GaussRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action gauss + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action gauss"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(GaussPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GaussRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gauss", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GaussRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gauss", rawUrl) + { + } + /// + /// Invoke action gauss + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GaussPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GaussPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gcd/GcdPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gcd/GcdPostRequestBody.cs new file mode 100644 index 0000000000..1e78cd4327 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gcd/GcdPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gcd +{ + #pragma warning disable CS1591 + public class GcdPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GcdPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static GcdPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GcdPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gcd/GcdRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gcd/GcdRequestBuilder.cs new file mode 100644 index 0000000000..ded4b8d8d9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Gcd/GcdRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Gcd +{ + /// + /// Provides operations to call the gcd method. + /// + public class GcdRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action gcd + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action gcd"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(GcdPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GcdRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gcd", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GcdRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/gcd", rawUrl) + { + } + /// + /// Invoke action gcd + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GcdPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GcdPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeStep/GeStepPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeStep/GeStepPostRequestBody.cs new file mode 100644 index 0000000000..0797f04674 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeStep/GeStepPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GeStep +{ + #pragma warning disable CS1591 + public class GeStepPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The step property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Step { get; set; } +#nullable restore +#else + public Json Step { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GeStepPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static GeStepPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GeStepPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "step", n => { Step = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("step", Step); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeStep/GeStepRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeStep/GeStepRequestBuilder.cs new file mode 100644 index 0000000000..39ffe97d94 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeStep/GeStepRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GeStep +{ + /// + /// Provides operations to call the geStep method. + /// + public class GeStepRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action geStep + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action geStep"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(GeStepPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GeStepRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/geStep", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GeStepRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/geStep", rawUrl) + { + } + /// + /// Invoke action geStep + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GeStepPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GeStepPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeoMean/GeoMeanPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeoMean/GeoMeanPostRequestBody.cs new file mode 100644 index 0000000000..a9568894ab --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeoMean/GeoMeanPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GeoMean +{ + #pragma warning disable CS1591 + public class GeoMeanPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GeoMeanPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static GeoMeanPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GeoMeanPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeoMean/GeoMeanRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeoMean/GeoMeanRequestBuilder.cs new file mode 100644 index 0000000000..6e4e6fd1b0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/GeoMean/GeoMeanRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.GeoMean +{ + /// + /// Provides operations to call the geoMean method. + /// + public class GeoMeanRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action geoMean + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action geoMean"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(GeoMeanPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GeoMeanRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/geoMean", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GeoMeanRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/geoMean", rawUrl) + { + } + /// + /// Invoke action geoMean + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GeoMeanPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GeoMeanPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HarMean/HarMeanPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HarMean/HarMeanPostRequestBody.cs new file mode 100644 index 0000000000..575e91ccb0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HarMean/HarMeanPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.HarMean +{ + #pragma warning disable CS1591 + public class HarMeanPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public HarMeanPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static HarMeanPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new HarMeanPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HarMean/HarMeanRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HarMean/HarMeanRequestBuilder.cs new file mode 100644 index 0000000000..273539dc9f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HarMean/HarMeanRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.HarMean +{ + /// + /// Provides operations to call the harMean method. + /// + public class HarMeanRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action harMean + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action harMean"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(HarMeanPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HarMeanRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/harMean", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HarMeanRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/harMean", rawUrl) + { + } + /// + /// Invoke action harMean + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(HarMeanPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(HarMeanPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Bin/Hex2BinPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Bin/Hex2BinPostRequestBody.cs new file mode 100644 index 0000000000..07286855fb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Bin/Hex2BinPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hex2Bin +{ + #pragma warning disable CS1591 + public class Hex2BinPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The places property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Places { get; set; } +#nullable restore +#else + public Json Places { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Hex2BinPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Hex2BinPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Hex2BinPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "places", n => { Places = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("places", Places); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Bin/Hex2BinRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Bin/Hex2BinRequestBuilder.cs new file mode 100644 index 0000000000..78e1c52e53 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Bin/Hex2BinRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hex2Bin +{ + /// + /// Provides operations to call the hex2Bin method. + /// + public class Hex2BinRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action hex2Bin + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action hex2Bin"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Hex2BinPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Hex2BinRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hex2Bin", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Hex2BinRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hex2Bin", rawUrl) + { + } + /// + /// Invoke action hex2Bin + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Hex2BinPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Hex2BinPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Dec/Hex2DecPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Dec/Hex2DecPostRequestBody.cs new file mode 100644 index 0000000000..9daa4a32af --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Dec/Hex2DecPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hex2Dec +{ + #pragma warning disable CS1591 + public class Hex2DecPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Hex2DecPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Hex2DecPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Hex2DecPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Dec/Hex2DecRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Dec/Hex2DecRequestBuilder.cs new file mode 100644 index 0000000000..5c9fcf4e57 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Dec/Hex2DecRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hex2Dec +{ + /// + /// Provides operations to call the hex2Dec method. + /// + public class Hex2DecRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action hex2Dec + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action hex2Dec"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Hex2DecPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Hex2DecRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hex2Dec", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Hex2DecRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hex2Dec", rawUrl) + { + } + /// + /// Invoke action hex2Dec + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Hex2DecPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Hex2DecPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Oct/Hex2OctPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Oct/Hex2OctPostRequestBody.cs new file mode 100644 index 0000000000..ac4e929a65 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Oct/Hex2OctPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hex2Oct +{ + #pragma warning disable CS1591 + public class Hex2OctPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The places property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Places { get; set; } +#nullable restore +#else + public Json Places { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Hex2OctPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Hex2OctPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Hex2OctPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "places", n => { Places = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("places", Places); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Oct/Hex2OctRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Oct/Hex2OctRequestBuilder.cs new file mode 100644 index 0000000000..940e30dc1a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hex2Oct/Hex2OctRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hex2Oct +{ + /// + /// Provides operations to call the hex2Oct method. + /// + public class Hex2OctRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action hex2Oct + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action hex2Oct"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Hex2OctPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Hex2OctRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hex2Oct", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Hex2OctRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hex2Oct", rawUrl) + { + } + /// + /// Invoke action hex2Oct + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Hex2OctPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Hex2OctPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hlookup/HlookupPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hlookup/HlookupPostRequestBody.cs new file mode 100644 index 0000000000..4f739bee63 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hlookup/HlookupPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hlookup +{ + #pragma warning disable CS1591 + public class HlookupPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The lookupValue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LookupValue { get; set; } +#nullable restore +#else + public Json LookupValue { get; set; } +#endif + /// The rangeLookup property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? RangeLookup { get; set; } +#nullable restore +#else + public Json RangeLookup { get; set; } +#endif + /// The rowIndexNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? RowIndexNum { get; set; } +#nullable restore +#else + public Json RowIndexNum { get; set; } +#endif + /// The tableArray property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? TableArray { get; set; } +#nullable restore +#else + public Json TableArray { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public HlookupPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static HlookupPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new HlookupPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "lookupValue", n => { LookupValue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rangeLookup", n => { RangeLookup = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rowIndexNum", n => { RowIndexNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "tableArray", n => { TableArray = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("lookupValue", LookupValue); + writer.WriteObjectValue("rangeLookup", RangeLookup); + writer.WriteObjectValue("rowIndexNum", RowIndexNum); + writer.WriteObjectValue("tableArray", TableArray); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hlookup/HlookupRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hlookup/HlookupRequestBuilder.cs new file mode 100644 index 0000000000..5b0d1629fb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hlookup/HlookupRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hlookup +{ + /// + /// Provides operations to call the hlookup method. + /// + public class HlookupRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action hlookup + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action hlookup"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(HlookupPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HlookupRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hlookup", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HlookupRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hlookup", rawUrl) + { + } + /// + /// Invoke action hlookup + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(HlookupPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(HlookupPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hour/HourPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hour/HourPostRequestBody.cs new file mode 100644 index 0000000000..8d23b1e099 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hour/HourPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hour +{ + #pragma warning disable CS1591 + public class HourPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The serialNumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SerialNumber { get; set; } +#nullable restore +#else + public Json SerialNumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public HourPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static HourPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new HourPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "serialNumber", n => { SerialNumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("serialNumber", SerialNumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hour/HourRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hour/HourRequestBuilder.cs new file mode 100644 index 0000000000..8494a43cee --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hour/HourRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hour +{ + /// + /// Provides operations to call the hour method. + /// + public class HourRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action hour + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action hour"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(HourPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HourRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hour", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HourRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hour", rawUrl) + { + } + /// + /// Invoke action hour + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(HourPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(HourPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistPostRequestBody.cs new file mode 100644 index 0000000000..24730340c9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.HypGeom_Dist +{ + #pragma warning disable CS1591 + public class HypGeom_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The numberPop property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberPop { get; set; } +#nullable restore +#else + public Json NumberPop { get; set; } +#endif + /// The numberSample property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberSample { get; set; } +#nullable restore +#else + public Json NumberSample { get; set; } +#endif + /// The populationS property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? PopulationS { get; set; } +#nullable restore +#else + public Json PopulationS { get; set; } +#endif + /// The sampleS property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SampleS { get; set; } +#nullable restore +#else + public Json SampleS { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public HypGeom_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static HypGeom_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new HypGeom_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberPop", n => { NumberPop = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberSample", n => { NumberSample = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "populationS", n => { PopulationS = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "sampleS", n => { SampleS = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("numberPop", NumberPop); + writer.WriteObjectValue("numberSample", NumberSample); + writer.WriteObjectValue("populationS", PopulationS); + writer.WriteObjectValue("sampleS", SampleS); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistRequestBuilder.cs new file mode 100644 index 0000000000..3a092bf8fe --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/HypGeom_Dist/HypGeom_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.HypGeom_Dist +{ + /// + /// Provides operations to call the hypGeom_Dist method. + /// + public class HypGeom_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action hypGeom_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action hypGeom_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(HypGeom_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HypGeom_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hypGeom_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HypGeom_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hypGeom_Dist", rawUrl) + { + } + /// + /// Invoke action hypGeom_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(HypGeom_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(HypGeom_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hyperlink/HyperlinkPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hyperlink/HyperlinkPostRequestBody.cs new file mode 100644 index 0000000000..6b3081efbe --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hyperlink/HyperlinkPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hyperlink +{ + #pragma warning disable CS1591 + public class HyperlinkPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The friendlyName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FriendlyName { get; set; } +#nullable restore +#else + public Json FriendlyName { get; set; } +#endif + /// The linkLocation property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LinkLocation { get; set; } +#nullable restore +#else + public Json LinkLocation { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public HyperlinkPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static HyperlinkPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new HyperlinkPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "friendlyName", n => { FriendlyName = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "linkLocation", n => { LinkLocation = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("friendlyName", FriendlyName); + writer.WriteObjectValue("linkLocation", LinkLocation); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hyperlink/HyperlinkRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hyperlink/HyperlinkRequestBuilder.cs new file mode 100644 index 0000000000..66dd38b054 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Hyperlink/HyperlinkRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Hyperlink +{ + /// + /// Provides operations to call the hyperlink method. + /// + public class HyperlinkRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action hyperlink + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action hyperlink"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(HyperlinkPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HyperlinkRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hyperlink", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HyperlinkRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/hyperlink", rawUrl) + { + } + /// + /// Invoke action hyperlink + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(HyperlinkPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(HyperlinkPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/If/IfPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/If/IfPostRequestBody.cs new file mode 100644 index 0000000000..9569ff87c9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/If/IfPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.If +{ + #pragma warning disable CS1591 + public class IfPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The logicalTest property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LogicalTest { get; set; } +#nullable restore +#else + public Json LogicalTest { get; set; } +#endif + /// The valueIfFalse property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ValueIfFalse { get; set; } +#nullable restore +#else + public Json ValueIfFalse { get; set; } +#endif + /// The valueIfTrue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ValueIfTrue { get; set; } +#nullable restore +#else + public Json ValueIfTrue { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IfPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IfPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IfPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "logicalTest", n => { LogicalTest = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "valueIfFalse", n => { ValueIfFalse = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "valueIfTrue", n => { ValueIfTrue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("logicalTest", LogicalTest); + writer.WriteObjectValue("valueIfFalse", ValueIfFalse); + writer.WriteObjectValue("valueIfTrue", ValueIfTrue); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/If/IfRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/If/IfRequestBuilder.cs new file mode 100644 index 0000000000..fc3847d7bc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/If/IfRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.If +{ + /// + /// Provides operations to call the if method. + /// + public class IfRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action if + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action if"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IfPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IfRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/if", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IfRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/if", rawUrl) + { + } + /// + /// Invoke action if + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IfPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IfPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImAbs/ImAbsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImAbs/ImAbsPostRequestBody.cs new file mode 100644 index 0000000000..6807db8dc2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImAbs/ImAbsPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImAbs +{ + #pragma warning disable CS1591 + public class ImAbsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImAbsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImAbsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImAbsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImAbs/ImAbsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImAbs/ImAbsRequestBuilder.cs new file mode 100644 index 0000000000..19561c48b3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImAbs/ImAbsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImAbs +{ + /// + /// Provides operations to call the imAbs method. + /// + public class ImAbsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imAbs + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imAbs"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImAbsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImAbsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imAbs", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImAbsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imAbs", rawUrl) + { + } + /// + /// Invoke action imAbs + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImAbsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImAbsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImArgument/ImArgumentPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImArgument/ImArgumentPostRequestBody.cs new file mode 100644 index 0000000000..76043dc847 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImArgument/ImArgumentPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImArgument +{ + #pragma warning disable CS1591 + public class ImArgumentPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImArgumentPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImArgumentPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImArgumentPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImArgument/ImArgumentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImArgument/ImArgumentRequestBuilder.cs new file mode 100644 index 0000000000..7d02e26da4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImArgument/ImArgumentRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImArgument +{ + /// + /// Provides operations to call the imArgument method. + /// + public class ImArgumentRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imArgument + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imArgument"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImArgumentPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImArgumentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imArgument", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImArgumentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imArgument", rawUrl) + { + } + /// + /// Invoke action imArgument + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImArgumentPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImArgumentPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImConjugate/ImConjugatePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImConjugate/ImConjugatePostRequestBody.cs new file mode 100644 index 0000000000..9368e7cddd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImConjugate/ImConjugatePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImConjugate +{ + #pragma warning disable CS1591 + public class ImConjugatePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImConjugatePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImConjugatePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImConjugatePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImConjugate/ImConjugateRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImConjugate/ImConjugateRequestBuilder.cs new file mode 100644 index 0000000000..e100843554 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImConjugate/ImConjugateRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImConjugate +{ + /// + /// Provides operations to call the imConjugate method. + /// + public class ImConjugateRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imConjugate + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imConjugate"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImConjugatePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImConjugateRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imConjugate", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImConjugateRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imConjugate", rawUrl) + { + } + /// + /// Invoke action imConjugate + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImConjugatePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImConjugatePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCos/ImCosPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCos/ImCosPostRequestBody.cs new file mode 100644 index 0000000000..19c25fa136 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCos/ImCosPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCos +{ + #pragma warning disable CS1591 + public class ImCosPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImCosPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImCosPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImCosPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCos/ImCosRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCos/ImCosRequestBuilder.cs new file mode 100644 index 0000000000..43e8d2ae33 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCos/ImCosRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCos +{ + /// + /// Provides operations to call the imCos method. + /// + public class ImCosRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imCos + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imCos"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImCosPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImCosRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCos", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImCosRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCos", rawUrl) + { + } + /// + /// Invoke action imCos + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImCosPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImCosPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCosh/ImCoshPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCosh/ImCoshPostRequestBody.cs new file mode 100644 index 0000000000..af8f2b4905 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCosh/ImCoshPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCosh +{ + #pragma warning disable CS1591 + public class ImCoshPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImCoshPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImCoshPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImCoshPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCosh/ImCoshRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCosh/ImCoshRequestBuilder.cs new file mode 100644 index 0000000000..f93ad741d5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCosh/ImCoshRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCosh +{ + /// + /// Provides operations to call the imCosh method. + /// + public class ImCoshRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imCosh + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imCosh"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImCoshPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImCoshRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCosh", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImCoshRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCosh", rawUrl) + { + } + /// + /// Invoke action imCosh + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImCoshPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImCoshPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCot/ImCotPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCot/ImCotPostRequestBody.cs new file mode 100644 index 0000000000..0c2cafb6af --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCot/ImCotPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCot +{ + #pragma warning disable CS1591 + public class ImCotPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImCotPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImCotPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImCotPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCot/ImCotRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCot/ImCotRequestBuilder.cs new file mode 100644 index 0000000000..d41fefe6c9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCot/ImCotRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCot +{ + /// + /// Provides operations to call the imCot method. + /// + public class ImCotRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imCot + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imCot"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImCotPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImCotRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCot", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImCotRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCot", rawUrl) + { + } + /// + /// Invoke action imCot + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImCotPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImCotPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsc/ImCscPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsc/ImCscPostRequestBody.cs new file mode 100644 index 0000000000..b0ddea9863 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsc/ImCscPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCsc +{ + #pragma warning disable CS1591 + public class ImCscPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImCscPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImCscPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImCscPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsc/ImCscRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsc/ImCscRequestBuilder.cs new file mode 100644 index 0000000000..65471019a9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsc/ImCscRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCsc +{ + /// + /// Provides operations to call the imCsc method. + /// + public class ImCscRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imCsc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imCsc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImCscPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImCscRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCsc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImCscRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCsc", rawUrl) + { + } + /// + /// Invoke action imCsc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImCscPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImCscPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsch/ImCschPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsch/ImCschPostRequestBody.cs new file mode 100644 index 0000000000..a7d8a2e567 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsch/ImCschPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCsch +{ + #pragma warning disable CS1591 + public class ImCschPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImCschPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImCschPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImCschPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsch/ImCschRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsch/ImCschRequestBuilder.cs new file mode 100644 index 0000000000..c7a59c839c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImCsch/ImCschRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImCsch +{ + /// + /// Provides operations to call the imCsch method. + /// + public class ImCschRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imCsch + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imCsch"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImCschPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImCschRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCsch", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImCschRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imCsch", rawUrl) + { + } + /// + /// Invoke action imCsch + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImCschPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImCschPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImDiv/ImDivPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImDiv/ImDivPostRequestBody.cs new file mode 100644 index 0000000000..18e51e3bc5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImDiv/ImDivPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImDiv +{ + #pragma warning disable CS1591 + public class ImDivPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber1 { get; set; } +#nullable restore +#else + public Json Inumber1 { get; set; } +#endif + /// The inumber2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber2 { get; set; } +#nullable restore +#else + public Json Inumber2 { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImDivPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImDivPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImDivPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber1", n => { Inumber1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "inumber2", n => { Inumber2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber1", Inumber1); + writer.WriteObjectValue("inumber2", Inumber2); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImDiv/ImDivRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImDiv/ImDivRequestBuilder.cs new file mode 100644 index 0000000000..33590b6ebb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImDiv/ImDivRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImDiv +{ + /// + /// Provides operations to call the imDiv method. + /// + public class ImDivRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imDiv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imDiv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImDivPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImDivRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imDiv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImDivRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imDiv", rawUrl) + { + } + /// + /// Invoke action imDiv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImDivPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImDivPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImExp/ImExpPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImExp/ImExpPostRequestBody.cs new file mode 100644 index 0000000000..ee04ce79d0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImExp/ImExpPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImExp +{ + #pragma warning disable CS1591 + public class ImExpPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImExpPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImExpPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImExpPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImExp/ImExpRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImExp/ImExpRequestBuilder.cs new file mode 100644 index 0000000000..bf79e30cde --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImExp/ImExpRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImExp +{ + /// + /// Provides operations to call the imExp method. + /// + public class ImExpRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imExp + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imExp"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImExpPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImExpRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imExp", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImExpRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imExp", rawUrl) + { + } + /// + /// Invoke action imExp + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImExpPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImExpPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLn/ImLnPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLn/ImLnPostRequestBody.cs new file mode 100644 index 0000000000..14609cbc05 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLn/ImLnPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImLn +{ + #pragma warning disable CS1591 + public class ImLnPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImLnPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImLnPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImLnPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLn/ImLnRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLn/ImLnRequestBuilder.cs new file mode 100644 index 0000000000..8be8518a72 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLn/ImLnRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImLn +{ + /// + /// Provides operations to call the imLn method. + /// + public class ImLnRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imLn + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imLn"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImLnPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImLnRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imLn", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImLnRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imLn", rawUrl) + { + } + /// + /// Invoke action imLn + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImLnPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImLnPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog10/ImLog10PostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog10/ImLog10PostRequestBody.cs new file mode 100644 index 0000000000..c0b6059162 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog10/ImLog10PostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImLog10 +{ + #pragma warning disable CS1591 + public class ImLog10PostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImLog10PostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImLog10PostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImLog10PostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog10/ImLog10RequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog10/ImLog10RequestBuilder.cs new file mode 100644 index 0000000000..650a68ff91 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog10/ImLog10RequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImLog10 +{ + /// + /// Provides operations to call the imLog10 method. + /// + public class ImLog10RequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imLog10 + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imLog10"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImLog10PostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImLog10RequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imLog10", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImLog10RequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imLog10", rawUrl) + { + } + /// + /// Invoke action imLog10 + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImLog10PostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImLog10PostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog2/ImLog2PostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog2/ImLog2PostRequestBody.cs new file mode 100644 index 0000000000..ff94ebdd59 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog2/ImLog2PostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImLog2 +{ + #pragma warning disable CS1591 + public class ImLog2PostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImLog2PostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImLog2PostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImLog2PostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog2/ImLog2RequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog2/ImLog2RequestBuilder.cs new file mode 100644 index 0000000000..4270385344 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImLog2/ImLog2RequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImLog2 +{ + /// + /// Provides operations to call the imLog2 method. + /// + public class ImLog2RequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imLog2 + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imLog2"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImLog2PostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImLog2RequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imLog2", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImLog2RequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imLog2", rawUrl) + { + } + /// + /// Invoke action imLog2 + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImLog2PostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImLog2PostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImPower/ImPowerPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImPower/ImPowerPostRequestBody.cs new file mode 100644 index 0000000000..b20677dfd4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImPower/ImPowerPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImPower +{ + #pragma warning disable CS1591 + public class ImPowerPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImPowerPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImPowerPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImPowerPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImPower/ImPowerRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImPower/ImPowerRequestBuilder.cs new file mode 100644 index 0000000000..79cba61a98 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImPower/ImPowerRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImPower +{ + /// + /// Provides operations to call the imPower method. + /// + public class ImPowerRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imPower + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imPower"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImPowerPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImPowerRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imPower", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImPowerRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imPower", rawUrl) + { + } + /// + /// Invoke action imPower + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImPowerPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImPowerPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImProduct/ImProductPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImProduct/ImProductPostRequestBody.cs new file mode 100644 index 0000000000..62ffcaae66 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImProduct/ImProductPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImProduct +{ + #pragma warning disable CS1591 + public class ImProductPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImProductPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImProductPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImProductPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImProduct/ImProductRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImProduct/ImProductRequestBuilder.cs new file mode 100644 index 0000000000..7f7b8acb6a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImProduct/ImProductRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImProduct +{ + /// + /// Provides operations to call the imProduct method. + /// + public class ImProductRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imProduct + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imProduct"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImProductPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImProductRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imProduct", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImProductRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imProduct", rawUrl) + { + } + /// + /// Invoke action imProduct + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImProductPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImProductPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImReal/ImRealPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImReal/ImRealPostRequestBody.cs new file mode 100644 index 0000000000..48973c35d8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImReal/ImRealPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImReal +{ + #pragma warning disable CS1591 + public class ImRealPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImRealPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImRealPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImRealPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImReal/ImRealRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImReal/ImRealRequestBuilder.cs new file mode 100644 index 0000000000..35f1b3ffdd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImReal/ImRealRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImReal +{ + /// + /// Provides operations to call the imReal method. + /// + public class ImRealRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imReal + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imReal"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImRealPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImRealRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imReal", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImRealRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imReal", rawUrl) + { + } + /// + /// Invoke action imReal + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImRealPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImRealPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSec/ImSecPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSec/ImSecPostRequestBody.cs new file mode 100644 index 0000000000..2576766bc9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSec/ImSecPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSec +{ + #pragma warning disable CS1591 + public class ImSecPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImSecPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImSecPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImSecPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSec/ImSecRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSec/ImSecRequestBuilder.cs new file mode 100644 index 0000000000..d2fda7061a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSec/ImSecRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSec +{ + /// + /// Provides operations to call the imSec method. + /// + public class ImSecRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imSec + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imSec"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImSecPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImSecRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSec", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImSecRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSec", rawUrl) + { + } + /// + /// Invoke action imSec + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImSecPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImSecPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSech/ImSechPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSech/ImSechPostRequestBody.cs new file mode 100644 index 0000000000..b5f0e8a394 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSech/ImSechPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSech +{ + #pragma warning disable CS1591 + public class ImSechPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImSechPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImSechPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImSechPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSech/ImSechRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSech/ImSechRequestBuilder.cs new file mode 100644 index 0000000000..112988993f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSech/ImSechRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSech +{ + /// + /// Provides operations to call the imSech method. + /// + public class ImSechRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imSech + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imSech"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImSechPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImSechRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSech", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImSechRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSech", rawUrl) + { + } + /// + /// Invoke action imSech + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImSechPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImSechPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSin/ImSinPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSin/ImSinPostRequestBody.cs new file mode 100644 index 0000000000..9fa3fb3527 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSin/ImSinPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSin +{ + #pragma warning disable CS1591 + public class ImSinPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImSinPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImSinPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImSinPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSin/ImSinRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSin/ImSinRequestBuilder.cs new file mode 100644 index 0000000000..a7cd5b9a4f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSin/ImSinRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSin +{ + /// + /// Provides operations to call the imSin method. + /// + public class ImSinRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imSin + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imSin"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImSinPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImSinRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSin", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImSinRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSin", rawUrl) + { + } + /// + /// Invoke action imSin + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImSinPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImSinPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSinh/ImSinhPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSinh/ImSinhPostRequestBody.cs new file mode 100644 index 0000000000..08991bba94 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSinh/ImSinhPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSinh +{ + #pragma warning disable CS1591 + public class ImSinhPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImSinhPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImSinhPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImSinhPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSinh/ImSinhRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSinh/ImSinhRequestBuilder.cs new file mode 100644 index 0000000000..9b20d89d9e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSinh/ImSinhRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSinh +{ + /// + /// Provides operations to call the imSinh method. + /// + public class ImSinhRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imSinh + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imSinh"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImSinhPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImSinhRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSinh", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImSinhRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSinh", rawUrl) + { + } + /// + /// Invoke action imSinh + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImSinhPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImSinhPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSqrt/ImSqrtPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSqrt/ImSqrtPostRequestBody.cs new file mode 100644 index 0000000000..eec66147f7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSqrt/ImSqrtPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSqrt +{ + #pragma warning disable CS1591 + public class ImSqrtPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImSqrtPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImSqrtPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImSqrtPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSqrt/ImSqrtRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSqrt/ImSqrtRequestBuilder.cs new file mode 100644 index 0000000000..61cff2f752 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSqrt/ImSqrtRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSqrt +{ + /// + /// Provides operations to call the imSqrt method. + /// + public class ImSqrtRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imSqrt + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imSqrt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImSqrtPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImSqrtRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSqrt", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImSqrtRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSqrt", rawUrl) + { + } + /// + /// Invoke action imSqrt + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImSqrtPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImSqrtPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSub/ImSubPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSub/ImSubPostRequestBody.cs new file mode 100644 index 0000000000..8a831ad538 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSub/ImSubPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSub +{ + #pragma warning disable CS1591 + public class ImSubPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber1 { get; set; } +#nullable restore +#else + public Json Inumber1 { get; set; } +#endif + /// The inumber2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber2 { get; set; } +#nullable restore +#else + public Json Inumber2 { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImSubPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImSubPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImSubPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber1", n => { Inumber1 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "inumber2", n => { Inumber2 = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber1", Inumber1); + writer.WriteObjectValue("inumber2", Inumber2); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSub/ImSubRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSub/ImSubRequestBuilder.cs new file mode 100644 index 0000000000..d61faa1ca8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSub/ImSubRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSub +{ + /// + /// Provides operations to call the imSub method. + /// + public class ImSubRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imSub + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imSub"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImSubPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImSubRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSub", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImSubRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSub", rawUrl) + { + } + /// + /// Invoke action imSub + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImSubPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImSubPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSum/ImSumPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSum/ImSumPostRequestBody.cs new file mode 100644 index 0000000000..f59f56264d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSum/ImSumPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSum +{ + #pragma warning disable CS1591 + public class ImSumPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImSumPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImSumPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImSumPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSum/ImSumRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSum/ImSumRequestBuilder.cs new file mode 100644 index 0000000000..b70775e002 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImSum/ImSumRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImSum +{ + /// + /// Provides operations to call the imSum method. + /// + public class ImSumRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imSum + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imSum"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImSumPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImSumRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSum", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImSumRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imSum", rawUrl) + { + } + /// + /// Invoke action imSum + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImSumPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImSumPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImTan/ImTanPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImTan/ImTanPostRequestBody.cs new file mode 100644 index 0000000000..29a6e71295 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImTan/ImTanPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImTan +{ + #pragma warning disable CS1591 + public class ImTanPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImTanPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImTanPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImTanPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImTan/ImTanRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImTan/ImTanRequestBuilder.cs new file mode 100644 index 0000000000..d16b79cf78 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ImTan/ImTanRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ImTan +{ + /// + /// Provides operations to call the imTan method. + /// + public class ImTanRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imTan + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imTan"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImTanPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImTanRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imTan", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImTanRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imTan", rawUrl) + { + } + /// + /// Invoke action imTan + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImTanPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImTanPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Imaginary/ImaginaryPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Imaginary/ImaginaryPostRequestBody.cs new file mode 100644 index 0000000000..ed56feb2ce --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Imaginary/ImaginaryPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Imaginary +{ + #pragma warning disable CS1591 + public class ImaginaryPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The inumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Inumber { get; set; } +#nullable restore +#else + public Json Inumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImaginaryPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImaginaryPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImaginaryPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "inumber", n => { Inumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("inumber", Inumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Imaginary/ImaginaryRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Imaginary/ImaginaryRequestBuilder.cs new file mode 100644 index 0000000000..4cc49f5f3a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Imaginary/ImaginaryRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Imaginary +{ + /// + /// Provides operations to call the imaginary method. + /// + public class ImaginaryRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action imaginary + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action imaginary"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ImaginaryPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImaginaryRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imaginary", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImaginaryRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/imaginary", rawUrl) + { + } + /// + /// Invoke action imaginary + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ImaginaryPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ImaginaryPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Int/IntPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Int/IntPostRequestBody.cs new file mode 100644 index 0000000000..fae7a5fa87 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Int/IntPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Int +{ + #pragma warning disable CS1591 + public class IntPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IntPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IntPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IntPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Int/IntRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Int/IntRequestBuilder.cs new file mode 100644 index 0000000000..6194e35799 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Int/IntRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Int +{ + /// + /// Provides operations to call the int method. + /// + public class IntRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action int + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action int"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IntPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IntRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/int", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IntRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/int", rawUrl) + { + } + /// + /// Invoke action int + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IntPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IntPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IntRate/IntRatePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IntRate/IntRatePostRequestBody.cs new file mode 100644 index 0000000000..d1b33806ef --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IntRate/IntRatePostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IntRate +{ + #pragma warning disable CS1591 + public class IntRatePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The investment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Investment { get; set; } +#nullable restore +#else + public Json Investment { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IntRatePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IntRatePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IntRatePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "investment", n => { Investment = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("investment", Investment); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IntRate/IntRateRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IntRate/IntRateRequestBuilder.cs new file mode 100644 index 0000000000..1ff0f958e1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IntRate/IntRateRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IntRate +{ + /// + /// Provides operations to call the intRate method. + /// + public class IntRateRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action intRate + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action intRate"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IntRatePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IntRateRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/intRate", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IntRateRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/intRate", rawUrl) + { + } + /// + /// Invoke action intRate + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IntRatePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IntRatePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ipmt/IpmtPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ipmt/IpmtPostRequestBody.cs new file mode 100644 index 0000000000..2ec1826f85 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ipmt/IpmtPostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ipmt +{ + #pragma warning disable CS1591 + public class IpmtPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fv { get; set; } +#nullable restore +#else + public Json Fv { get; set; } +#endif + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The per property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Per { get; set; } +#nullable restore +#else + public Json Per { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Type { get; set; } +#nullable restore +#else + public Json Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IpmtPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IpmtPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IpmtPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fv", n => { Fv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "per", n => { Per = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fv", Fv); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("per", Per); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ipmt/IpmtRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ipmt/IpmtRequestBuilder.cs new file mode 100644 index 0000000000..5b066a3b1e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ipmt/IpmtRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ipmt +{ + /// + /// Provides operations to call the ipmt method. + /// + public class IpmtRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action ipmt + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action ipmt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IpmtPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IpmtRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ipmt", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IpmtRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ipmt", rawUrl) + { + } + /// + /// Invoke action ipmt + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IpmtPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IpmtPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Irr/IrrPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Irr/IrrPostRequestBody.cs new file mode 100644 index 0000000000..a68fae1a2f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Irr/IrrPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Irr +{ + #pragma warning disable CS1591 + public class IrrPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The guess property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Guess { get; set; } +#nullable restore +#else + public Json Guess { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IrrPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IrrPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IrrPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "guess", n => { Guess = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("guess", Guess); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Irr/IrrRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Irr/IrrRequestBuilder.cs new file mode 100644 index 0000000000..a5689e4ec8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Irr/IrrRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Irr +{ + /// + /// Provides operations to call the irr method. + /// + public class IrrRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action irr + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action irr"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IrrPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IrrRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/irr", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IrrRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/irr", rawUrl) + { + } + /// + /// Invoke action irr + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IrrPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IrrPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsErr/IsErrPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsErr/IsErrPostRequestBody.cs new file mode 100644 index 0000000000..c1d4890e4a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsErr/IsErrPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsErr +{ + #pragma warning disable CS1591 + public class IsErrPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsErrPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsErrPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsErrPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsErr/IsErrRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsErr/IsErrRequestBuilder.cs new file mode 100644 index 0000000000..1d0555cf49 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsErr/IsErrRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsErr +{ + /// + /// Provides operations to call the isErr method. + /// + public class IsErrRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isErr + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isErr"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsErrPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsErrRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isErr", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsErrRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isErr", rawUrl) + { + } + /// + /// Invoke action isErr + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsErrPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsErrPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsError/IsErrorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsError/IsErrorPostRequestBody.cs new file mode 100644 index 0000000000..e9bd8bfb94 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsError/IsErrorPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsError +{ + #pragma warning disable CS1591 + public class IsErrorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsErrorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsErrorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsErrorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsError/IsErrorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsError/IsErrorRequestBuilder.cs new file mode 100644 index 0000000000..2b66f6fca7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsError/IsErrorRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsError +{ + /// + /// Provides operations to call the isError method. + /// + public class IsErrorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isError + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isError"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsErrorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsErrorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isError", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsErrorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isError", rawUrl) + { + } + /// + /// Invoke action isError + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsErrorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsErrorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsEven/IsEvenPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsEven/IsEvenPostRequestBody.cs new file mode 100644 index 0000000000..406d422182 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsEven/IsEvenPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsEven +{ + #pragma warning disable CS1591 + public class IsEvenPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsEvenPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsEvenPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsEvenPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsEven/IsEvenRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsEven/IsEvenRequestBuilder.cs new file mode 100644 index 0000000000..b8a265c147 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsEven/IsEvenRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsEven +{ + /// + /// Provides operations to call the isEven method. + /// + public class IsEvenRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isEven + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isEven"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsEvenPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsEvenRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isEven", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsEvenRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isEven", rawUrl) + { + } + /// + /// Invoke action isEven + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsEvenPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsEvenPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsFormula/IsFormulaPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsFormula/IsFormulaPostRequestBody.cs new file mode 100644 index 0000000000..5580d73fe3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsFormula/IsFormulaPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsFormula +{ + #pragma warning disable CS1591 + public class IsFormulaPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The reference property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Reference { get; set; } +#nullable restore +#else + public Json Reference { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsFormulaPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsFormulaPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsFormulaPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "reference", n => { Reference = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("reference", Reference); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsFormula/IsFormulaRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsFormula/IsFormulaRequestBuilder.cs new file mode 100644 index 0000000000..4c98ac7eb4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsFormula/IsFormulaRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsFormula +{ + /// + /// Provides operations to call the isFormula method. + /// + public class IsFormulaRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isFormula + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isFormula"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsFormulaPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsFormulaRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isFormula", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsFormulaRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isFormula", rawUrl) + { + } + /// + /// Invoke action isFormula + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsFormulaPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsFormulaPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsLogical/IsLogicalPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsLogical/IsLogicalPostRequestBody.cs new file mode 100644 index 0000000000..27c4b4d437 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsLogical/IsLogicalPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsLogical +{ + #pragma warning disable CS1591 + public class IsLogicalPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsLogicalPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsLogicalPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsLogicalPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsLogical/IsLogicalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsLogical/IsLogicalRequestBuilder.cs new file mode 100644 index 0000000000..7ae73c6d50 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsLogical/IsLogicalRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsLogical +{ + /// + /// Provides operations to call the isLogical method. + /// + public class IsLogicalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isLogical + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isLogical"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsLogicalPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsLogicalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isLogical", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsLogicalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isLogical", rawUrl) + { + } + /// + /// Invoke action isLogical + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsLogicalPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsLogicalPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNA/IsNAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNA/IsNAPostRequestBody.cs new file mode 100644 index 0000000000..7189e6cf61 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNA/IsNAPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsNA +{ + #pragma warning disable CS1591 + public class IsNAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsNAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsNAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsNAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNA/IsNARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNA/IsNARequestBuilder.cs new file mode 100644 index 0000000000..244734e04d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNA/IsNARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsNA +{ + /// + /// Provides operations to call the isNA method. + /// + public class IsNARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isNA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isNA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsNAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsNARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isNA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsNARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isNA", rawUrl) + { + } + /// + /// Invoke action isNA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsNAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsNAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNonText/IsNonTextPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNonText/IsNonTextPostRequestBody.cs new file mode 100644 index 0000000000..ccec5d0851 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNonText/IsNonTextPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsNonText +{ + #pragma warning disable CS1591 + public class IsNonTextPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsNonTextPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsNonTextPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsNonTextPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNonText/IsNonTextRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNonText/IsNonTextRequestBuilder.cs new file mode 100644 index 0000000000..44da18f68f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNonText/IsNonTextRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsNonText +{ + /// + /// Provides operations to call the isNonText method. + /// + public class IsNonTextRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isNonText + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isNonText"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsNonTextPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsNonTextRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isNonText", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsNonTextRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isNonText", rawUrl) + { + } + /// + /// Invoke action isNonText + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsNonTextPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsNonTextPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNumber/IsNumberPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNumber/IsNumberPostRequestBody.cs new file mode 100644 index 0000000000..4126627da9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNumber/IsNumberPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsNumber +{ + #pragma warning disable CS1591 + public class IsNumberPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsNumberPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsNumberPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsNumberPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNumber/IsNumberRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNumber/IsNumberRequestBuilder.cs new file mode 100644 index 0000000000..76d96c4426 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsNumber/IsNumberRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsNumber +{ + /// + /// Provides operations to call the isNumber method. + /// + public class IsNumberRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isNumber + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isNumber"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsNumberPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsNumberRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isNumber", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsNumberRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isNumber", rawUrl) + { + } + /// + /// Invoke action isNumber + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsNumberPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsNumberPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsOdd/IsOddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsOdd/IsOddPostRequestBody.cs new file mode 100644 index 0000000000..882d2f426a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsOdd/IsOddPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsOdd +{ + #pragma warning disable CS1591 + public class IsOddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsOddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsOddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsOddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsOdd/IsOddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsOdd/IsOddRequestBuilder.cs new file mode 100644 index 0000000000..2a08fd76e7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsOdd/IsOddRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsOdd +{ + /// + /// Provides operations to call the isOdd method. + /// + public class IsOddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isOdd + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isOdd"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsOddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsOddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isOdd", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsOddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isOdd", rawUrl) + { + } + /// + /// Invoke action isOdd + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsOddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsOddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsText/IsTextPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsText/IsTextPostRequestBody.cs new file mode 100644 index 0000000000..8e78e39a3f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsText/IsTextPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsText +{ + #pragma warning disable CS1591 + public class IsTextPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsTextPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsTextPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsTextPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsText/IsTextRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsText/IsTextRequestBuilder.cs new file mode 100644 index 0000000000..0c6f35f107 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsText/IsTextRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsText +{ + /// + /// Provides operations to call the isText method. + /// + public class IsTextRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isText + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isText"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsTextPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsTextRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isText", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsTextRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isText", rawUrl) + { + } + /// + /// Invoke action isText + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsTextPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsTextPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumPostRequestBody.cs new file mode 100644 index 0000000000..e475146e15 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsoWeekNum +{ + #pragma warning disable CS1591 + public class IsoWeekNumPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The date property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Date { get; set; } +#nullable restore +#else + public Json Date { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsoWeekNumPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsoWeekNumPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsoWeekNumPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "date", n => { Date = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("date", Date); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumRequestBuilder.cs new file mode 100644 index 0000000000..f29b716f7e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/IsoWeekNum/IsoWeekNumRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.IsoWeekNum +{ + /// + /// Provides operations to call the isoWeekNum method. + /// + public class IsoWeekNumRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isoWeekNum + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isoWeekNum"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsoWeekNumPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsoWeekNumRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isoWeekNum", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsoWeekNumRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isoWeekNum", rawUrl) + { + } + /// + /// Invoke action isoWeekNum + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsoWeekNumPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsoWeekNumPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingPostRequestBody.cs new file mode 100644 index 0000000000..ced788b8ef --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Iso_Ceiling +{ + #pragma warning disable CS1591 + public class Iso_CeilingPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The significance property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Significance { get; set; } +#nullable restore +#else + public Json Significance { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Iso_CeilingPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Iso_CeilingPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Iso_CeilingPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "significance", n => { Significance = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("significance", Significance); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingRequestBuilder.cs new file mode 100644 index 0000000000..e54875eaf4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Iso_Ceiling/Iso_CeilingRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Iso_Ceiling +{ + /// + /// Provides operations to call the iso_Ceiling method. + /// + public class Iso_CeilingRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action iso_Ceiling + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action iso_Ceiling"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Iso_CeilingPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Iso_CeilingRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/iso_Ceiling", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Iso_CeilingRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/iso_Ceiling", rawUrl) + { + } + /// + /// Invoke action iso_Ceiling + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Iso_CeilingPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Iso_CeilingPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ispmt/IspmtPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ispmt/IspmtPostRequestBody.cs new file mode 100644 index 0000000000..6b7782d2e8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ispmt/IspmtPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ispmt +{ + #pragma warning disable CS1591 + public class IspmtPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The per property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Per { get; set; } +#nullable restore +#else + public Json Per { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IspmtPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IspmtPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IspmtPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "per", n => { Per = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("per", Per); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("rate", Rate); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ispmt/IspmtRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ispmt/IspmtRequestBuilder.cs new file mode 100644 index 0000000000..0ee540d01f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ispmt/IspmtRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ispmt +{ + /// + /// Provides operations to call the ispmt method. + /// + public class IspmtRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action ispmt + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action ispmt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IspmtPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IspmtRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ispmt", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IspmtRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ispmt", rawUrl) + { + } + /// + /// Invoke action ispmt + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IspmtPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IspmtPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Isref/IsrefPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Isref/IsrefPostRequestBody.cs new file mode 100644 index 0000000000..f484580dfc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Isref/IsrefPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Isref +{ + #pragma warning disable CS1591 + public class IsrefPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public IsrefPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsrefPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsrefPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Isref/IsrefRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Isref/IsrefRequestBuilder.cs new file mode 100644 index 0000000000..f8550913e7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Isref/IsrefRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Isref +{ + /// + /// Provides operations to call the isref method. + /// + public class IsrefRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action isref + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action isref"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(IsrefPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsrefRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isref", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsrefRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/isref", rawUrl) + { + } + /// + /// Invoke action isref + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IsrefPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IsrefPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Kurt/KurtPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Kurt/KurtPostRequestBody.cs new file mode 100644 index 0000000000..ad80e802d8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Kurt/KurtPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Kurt +{ + #pragma warning disable CS1591 + public class KurtPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public KurtPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static KurtPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new KurtPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Kurt/KurtRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Kurt/KurtRequestBuilder.cs new file mode 100644 index 0000000000..45b80a8005 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Kurt/KurtRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Kurt +{ + /// + /// Provides operations to call the kurt method. + /// + public class KurtRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action kurt + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action kurt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(KurtPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public KurtRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/kurt", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public KurtRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/kurt", rawUrl) + { + } + /// + /// Invoke action kurt + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(KurtPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(KurtPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Large/LargePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Large/LargePostRequestBody.cs new file mode 100644 index 0000000000..dd1a3b7e3e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Large/LargePostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Large +{ + #pragma warning disable CS1591 + public class LargePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The k property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? K { get; set; } +#nullable restore +#else + public Json K { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LargePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LargePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LargePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "k", n => { K = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("k", K); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Large/LargeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Large/LargeRequestBuilder.cs new file mode 100644 index 0000000000..33eba35061 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Large/LargeRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Large +{ + /// + /// Provides operations to call the large method. + /// + public class LargeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action large + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action large"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LargePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LargeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/large", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LargeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/large", rawUrl) + { + } + /// + /// Invoke action large + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LargePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LargePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lcm/LcmPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lcm/LcmPostRequestBody.cs new file mode 100644 index 0000000000..76bc46b6a1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lcm/LcmPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lcm +{ + #pragma warning disable CS1591 + public class LcmPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LcmPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LcmPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LcmPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lcm/LcmRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lcm/LcmRequestBuilder.cs new file mode 100644 index 0000000000..06aae0d0a8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lcm/LcmRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lcm +{ + /// + /// Provides operations to call the lcm method. + /// + public class LcmRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action lcm + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action lcm"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LcmPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LcmRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/lcm", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LcmRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/lcm", rawUrl) + { + } + /// + /// Invoke action lcm + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LcmPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LcmPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Left/LeftPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Left/LeftPostRequestBody.cs new file mode 100644 index 0000000000..349ff8afe7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Left/LeftPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Left +{ + #pragma warning disable CS1591 + public class LeftPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The numChars property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumChars { get; set; } +#nullable restore +#else + public Json NumChars { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LeftPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LeftPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LeftPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numChars", n => { NumChars = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("numChars", NumChars); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Left/LeftRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Left/LeftRequestBuilder.cs new file mode 100644 index 0000000000..987566d62a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Left/LeftRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Left +{ + /// + /// Provides operations to call the left method. + /// + public class LeftRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action left + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action left"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LeftPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LeftRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/left", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LeftRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/left", rawUrl) + { + } + /// + /// Invoke action left + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LeftPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LeftPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Leftb/LeftbPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Leftb/LeftbPostRequestBody.cs new file mode 100644 index 0000000000..ab3ba451c0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Leftb/LeftbPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Leftb +{ + #pragma warning disable CS1591 + public class LeftbPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The numBytes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumBytes { get; set; } +#nullable restore +#else + public Json NumBytes { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LeftbPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LeftbPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LeftbPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numBytes", n => { NumBytes = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("numBytes", NumBytes); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Leftb/LeftbRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Leftb/LeftbRequestBuilder.cs new file mode 100644 index 0000000000..bd108ebca1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Leftb/LeftbRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Leftb +{ + /// + /// Provides operations to call the leftb method. + /// + public class LeftbRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action leftb + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action leftb"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LeftbPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LeftbRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/leftb", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LeftbRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/leftb", rawUrl) + { + } + /// + /// Invoke action leftb + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LeftbPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LeftbPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Len/LenPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Len/LenPostRequestBody.cs new file mode 100644 index 0000000000..bde4a370d5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Len/LenPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Len +{ + #pragma warning disable CS1591 + public class LenPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LenPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LenPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LenPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Len/LenRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Len/LenRequestBuilder.cs new file mode 100644 index 0000000000..9d1cd64f56 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Len/LenRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Len +{ + /// + /// Provides operations to call the len method. + /// + public class LenRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action len + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action len"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LenPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LenRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/len", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LenRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/len", rawUrl) + { + } + /// + /// Invoke action len + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LenPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LenPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lenb/LenbPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lenb/LenbPostRequestBody.cs new file mode 100644 index 0000000000..a78262cacc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lenb/LenbPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lenb +{ + #pragma warning disable CS1591 + public class LenbPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LenbPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LenbPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LenbPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lenb/LenbRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lenb/LenbRequestBuilder.cs new file mode 100644 index 0000000000..85c69f7a69 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lenb/LenbRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lenb +{ + /// + /// Provides operations to call the lenb method. + /// + public class LenbRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action lenb + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action lenb"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LenbPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LenbRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/lenb", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LenbRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/lenb", rawUrl) + { + } + /// + /// Invoke action lenb + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LenbPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LenbPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ln/LnPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ln/LnPostRequestBody.cs new file mode 100644 index 0000000000..b306c8cb7a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ln/LnPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ln +{ + #pragma warning disable CS1591 + public class LnPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LnPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LnPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LnPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ln/LnRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ln/LnRequestBuilder.cs new file mode 100644 index 0000000000..083e6459b0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ln/LnRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ln +{ + /// + /// Provides operations to call the ln method. + /// + public class LnRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action ln + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action ln"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LnPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LnRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ln", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LnRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ln", rawUrl) + { + } + /// + /// Invoke action ln + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LnPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LnPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log/LogPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log/LogPostRequestBody.cs new file mode 100644 index 0000000000..3302ba4a87 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log/LogPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Log +{ + #pragma warning disable CS1591 + public class LogPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The base property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Base { get; set; } +#nullable restore +#else + public Json Base { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LogPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LogPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LogPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "base", n => { Base = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("base", Base); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log/LogRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log/LogRequestBuilder.cs new file mode 100644 index 0000000000..820f84dd80 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log/LogRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Log +{ + /// + /// Provides operations to call the log method. + /// + public class LogRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action log + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action log"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LogPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LogRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/log", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LogRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/log", rawUrl) + { + } + /// + /// Invoke action log + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LogPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LogPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log10/Log10PostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log10/Log10PostRequestBody.cs new file mode 100644 index 0000000000..1b60ca843c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log10/Log10PostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Log10 +{ + #pragma warning disable CS1591 + public class Log10PostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Log10PostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Log10PostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Log10PostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log10/Log10RequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log10/Log10RequestBuilder.cs new file mode 100644 index 0000000000..5447ca2ed5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Log10/Log10RequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Log10 +{ + /// + /// Provides operations to call the log10 method. + /// + public class Log10RequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action log10 + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action log10"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Log10PostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Log10RequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/log10", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Log10RequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/log10", rawUrl) + { + } + /// + /// Invoke action log10 + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Log10PostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Log10PostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistPostRequestBody.cs new file mode 100644 index 0000000000..9ca7358ec6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.LogNorm_Dist +{ + #pragma warning disable CS1591 + public class LogNorm_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The mean property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Mean { get; set; } +#nullable restore +#else + public Json Mean { get; set; } +#endif + /// The standardDev property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StandardDev { get; set; } +#nullable restore +#else + public Json StandardDev { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LogNorm_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LogNorm_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LogNorm_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "mean", n => { Mean = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "standardDev", n => { StandardDev = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("mean", Mean); + writer.WriteObjectValue("standardDev", StandardDev); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistRequestBuilder.cs new file mode 100644 index 0000000000..53c4b38fb0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Dist/LogNorm_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.LogNorm_Dist +{ + /// + /// Provides operations to call the logNorm_Dist method. + /// + public class LogNorm_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action logNorm_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action logNorm_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LogNorm_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LogNorm_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/logNorm_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LogNorm_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/logNorm_Dist", rawUrl) + { + } + /// + /// Invoke action logNorm_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LogNorm_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LogNorm_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvPostRequestBody.cs new file mode 100644 index 0000000000..eb09622813 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.LogNorm_Inv +{ + #pragma warning disable CS1591 + public class LogNorm_InvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The mean property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Mean { get; set; } +#nullable restore +#else + public Json Mean { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// The standardDev property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StandardDev { get; set; } +#nullable restore +#else + public Json StandardDev { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LogNorm_InvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LogNorm_InvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LogNorm_InvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "mean", n => { Mean = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "standardDev", n => { StandardDev = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mean", Mean); + writer.WriteObjectValue("probability", Probability); + writer.WriteObjectValue("standardDev", StandardDev); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvRequestBuilder.cs new file mode 100644 index 0000000000..f0bbb6c2f8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/LogNorm_Inv/LogNorm_InvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.LogNorm_Inv +{ + /// + /// Provides operations to call the logNorm_Inv method. + /// + public class LogNorm_InvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action logNorm_Inv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action logNorm_Inv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LogNorm_InvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LogNorm_InvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/logNorm_Inv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LogNorm_InvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/logNorm_Inv", rawUrl) + { + } + /// + /// Invoke action logNorm_Inv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LogNorm_InvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LogNorm_InvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lookup/LookupPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lookup/LookupPostRequestBody.cs new file mode 100644 index 0000000000..613a45733c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lookup/LookupPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lookup +{ + #pragma warning disable CS1591 + public class LookupPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The lookupValue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LookupValue { get; set; } +#nullable restore +#else + public Json LookupValue { get; set; } +#endif + /// The lookupVector property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LookupVector { get; set; } +#nullable restore +#else + public Json LookupVector { get; set; } +#endif + /// The resultVector property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ResultVector { get; set; } +#nullable restore +#else + public Json ResultVector { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LookupPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LookupPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LookupPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "lookupValue", n => { LookupValue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "lookupVector", n => { LookupVector = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "resultVector", n => { ResultVector = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("lookupValue", LookupValue); + writer.WriteObjectValue("lookupVector", LookupVector); + writer.WriteObjectValue("resultVector", ResultVector); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lookup/LookupRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lookup/LookupRequestBuilder.cs new file mode 100644 index 0000000000..3a5f3e2a1f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lookup/LookupRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lookup +{ + /// + /// Provides operations to call the lookup method. + /// + public class LookupRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action lookup + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action lookup"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LookupPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LookupRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/lookup", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LookupRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/lookup", rawUrl) + { + } + /// + /// Invoke action lookup + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LookupPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LookupPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lower/LowerPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lower/LowerPostRequestBody.cs new file mode 100644 index 0000000000..ace64e3b3e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lower/LowerPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lower +{ + #pragma warning disable CS1591 + public class LowerPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public LowerPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static LowerPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LowerPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lower/LowerRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lower/LowerRequestBuilder.cs new file mode 100644 index 0000000000..cf5340fc34 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Lower/LowerRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Lower +{ + /// + /// Provides operations to call the lower method. + /// + public class LowerRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action lower + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action lower"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(LowerPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LowerRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/lower", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LowerRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/lower", rawUrl) + { + } + /// + /// Invoke action lower + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(LowerPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(LowerPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Match/MatchPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Match/MatchPostRequestBody.cs new file mode 100644 index 0000000000..d672192c40 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Match/MatchPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Match +{ + #pragma warning disable CS1591 + public class MatchPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The lookupArray property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LookupArray { get; set; } +#nullable restore +#else + public Json LookupArray { get; set; } +#endif + /// The lookupValue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LookupValue { get; set; } +#nullable restore +#else + public Json LookupValue { get; set; } +#endif + /// The matchType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? MatchType { get; set; } +#nullable restore +#else + public Json MatchType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MatchPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MatchPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MatchPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "lookupArray", n => { LookupArray = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "lookupValue", n => { LookupValue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "matchType", n => { MatchType = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("lookupArray", LookupArray); + writer.WriteObjectValue("lookupValue", LookupValue); + writer.WriteObjectValue("matchType", MatchType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Match/MatchRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Match/MatchRequestBuilder.cs new file mode 100644 index 0000000000..cb71294165 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Match/MatchRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Match +{ + /// + /// Provides operations to call the match method. + /// + public class MatchRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action match + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action match"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MatchPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MatchRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/match", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MatchRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/match", rawUrl) + { + } + /// + /// Invoke action match + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MatchPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MatchPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Max/MaxPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Max/MaxPostRequestBody.cs new file mode 100644 index 0000000000..262b7c6dd7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Max/MaxPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Max +{ + #pragma warning disable CS1591 + public class MaxPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MaxPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MaxPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MaxPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Max/MaxRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Max/MaxRequestBuilder.cs new file mode 100644 index 0000000000..b5da3c2db0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Max/MaxRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Max +{ + /// + /// Provides operations to call the max method. + /// + public class MaxRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action max + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action max"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MaxPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MaxRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/max", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MaxRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/max", rawUrl) + { + } + /// + /// Invoke action max + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MaxPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MaxPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MaxA/MaxAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MaxA/MaxAPostRequestBody.cs new file mode 100644 index 0000000000..8bcd532ee9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MaxA/MaxAPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.MaxA +{ + #pragma warning disable CS1591 + public class MaxAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MaxAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MaxAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MaxAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MaxA/MaxARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MaxA/MaxARequestBuilder.cs new file mode 100644 index 0000000000..07852028f6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MaxA/MaxARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.MaxA +{ + /// + /// Provides operations to call the maxA method. + /// + public class MaxARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action maxA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action maxA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MaxAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MaxARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/maxA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MaxARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/maxA", rawUrl) + { + } + /// + /// Invoke action maxA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MaxAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MaxAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mduration/MdurationPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mduration/MdurationPostRequestBody.cs new file mode 100644 index 0000000000..eda7f5d899 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mduration/MdurationPostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mduration +{ + #pragma warning disable CS1591 + public class MdurationPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The coupon property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Coupon { get; set; } +#nullable restore +#else + public Json Coupon { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// The yld property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Yld { get; set; } +#nullable restore +#else + public Json Yld { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MdurationPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MdurationPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MdurationPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "coupon", n => { Coupon = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "yld", n => { Yld = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("coupon", Coupon); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteObjectValue("yld", Yld); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mduration/MdurationRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mduration/MdurationRequestBuilder.cs new file mode 100644 index 0000000000..8fa239b583 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mduration/MdurationRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mduration +{ + /// + /// Provides operations to call the mduration method. + /// + public class MdurationRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action mduration + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action mduration"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MdurationPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MdurationRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mduration", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MdurationRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mduration", rawUrl) + { + } + /// + /// Invoke action mduration + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MdurationPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MdurationPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Median/MedianPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Median/MedianPostRequestBody.cs new file mode 100644 index 0000000000..7fab81b03a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Median/MedianPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Median +{ + #pragma warning disable CS1591 + public class MedianPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MedianPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MedianPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MedianPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Median/MedianRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Median/MedianRequestBuilder.cs new file mode 100644 index 0000000000..0f42114532 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Median/MedianRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Median +{ + /// + /// Provides operations to call the median method. + /// + public class MedianRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action median + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action median"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MedianPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MedianRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/median", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MedianRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/median", rawUrl) + { + } + /// + /// Invoke action median + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MedianPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MedianPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mid/MidPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mid/MidPostRequestBody.cs new file mode 100644 index 0000000000..a87d7af3ca --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mid/MidPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mid +{ + #pragma warning disable CS1591 + public class MidPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The numChars property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumChars { get; set; } +#nullable restore +#else + public Json NumChars { get; set; } +#endif + /// The startNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartNum { get; set; } +#nullable restore +#else + public Json StartNum { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MidPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MidPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MidPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numChars", n => { NumChars = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startNum", n => { StartNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("numChars", NumChars); + writer.WriteObjectValue("startNum", StartNum); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mid/MidRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mid/MidRequestBuilder.cs new file mode 100644 index 0000000000..60a911887a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mid/MidRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mid +{ + /// + /// Provides operations to call the mid method. + /// + public class MidRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action mid + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action mid"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MidPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MidRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mid", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MidRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mid", rawUrl) + { + } + /// + /// Invoke action mid + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MidPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MidPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Midb/MidbPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Midb/MidbPostRequestBody.cs new file mode 100644 index 0000000000..8f28a1bdd3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Midb/MidbPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Midb +{ + #pragma warning disable CS1591 + public class MidbPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The numBytes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumBytes { get; set; } +#nullable restore +#else + public Json NumBytes { get; set; } +#endif + /// The startNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartNum { get; set; } +#nullable restore +#else + public Json StartNum { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MidbPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MidbPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MidbPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numBytes", n => { NumBytes = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startNum", n => { StartNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("numBytes", NumBytes); + writer.WriteObjectValue("startNum", StartNum); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Midb/MidbRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Midb/MidbRequestBuilder.cs new file mode 100644 index 0000000000..ce1444804e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Midb/MidbRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Midb +{ + /// + /// Provides operations to call the midb method. + /// + public class MidbRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action midb + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action midb"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MidbPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MidbRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/midb", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MidbRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/midb", rawUrl) + { + } + /// + /// Invoke action midb + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MidbPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MidbPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Min/MinPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Min/MinPostRequestBody.cs new file mode 100644 index 0000000000..3e27e4829a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Min/MinPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Min +{ + #pragma warning disable CS1591 + public class MinPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MinPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MinPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MinPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Min/MinRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Min/MinRequestBuilder.cs new file mode 100644 index 0000000000..57ff3c2432 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Min/MinRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Min +{ + /// + /// Provides operations to call the min method. + /// + public class MinRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action min + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action min"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MinPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MinRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/min", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MinRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/min", rawUrl) + { + } + /// + /// Invoke action min + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MinPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MinPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MinA/MinAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MinA/MinAPostRequestBody.cs new file mode 100644 index 0000000000..c719afa353 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MinA/MinAPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.MinA +{ + #pragma warning disable CS1591 + public class MinAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MinAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MinAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MinAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MinA/MinARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MinA/MinARequestBuilder.cs new file mode 100644 index 0000000000..6fbd07fded --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MinA/MinARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.MinA +{ + /// + /// Provides operations to call the minA method. + /// + public class MinARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action minA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action minA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MinAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MinARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/minA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MinARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/minA", rawUrl) + { + } + /// + /// Invoke action minA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MinAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MinAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Minute/MinutePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Minute/MinutePostRequestBody.cs new file mode 100644 index 0000000000..958c64725c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Minute/MinutePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Minute +{ + #pragma warning disable CS1591 + public class MinutePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The serialNumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SerialNumber { get; set; } +#nullable restore +#else + public Json SerialNumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MinutePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MinutePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MinutePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "serialNumber", n => { SerialNumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("serialNumber", SerialNumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Minute/MinuteRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Minute/MinuteRequestBuilder.cs new file mode 100644 index 0000000000..37a8c978c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Minute/MinuteRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Minute +{ + /// + /// Provides operations to call the minute method. + /// + public class MinuteRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action minute + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action minute"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MinutePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MinuteRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/minute", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MinuteRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/minute", rawUrl) + { + } + /// + /// Invoke action minute + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MinutePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MinutePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mirr/MirrPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mirr/MirrPostRequestBody.cs new file mode 100644 index 0000000000..a0183e1973 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mirr/MirrPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mirr +{ + #pragma warning disable CS1591 + public class MirrPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The financeRate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FinanceRate { get; set; } +#nullable restore +#else + public Json FinanceRate { get; set; } +#endif + /// The reinvestRate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ReinvestRate { get; set; } +#nullable restore +#else + public Json ReinvestRate { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MirrPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MirrPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MirrPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "financeRate", n => { FinanceRate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "reinvestRate", n => { ReinvestRate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("financeRate", FinanceRate); + writer.WriteObjectValue("reinvestRate", ReinvestRate); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mirr/MirrRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mirr/MirrRequestBuilder.cs new file mode 100644 index 0000000000..7bd0f427e3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mirr/MirrRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mirr +{ + /// + /// Provides operations to call the mirr method. + /// + public class MirrRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action mirr + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action mirr"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MirrPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MirrRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mirr", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MirrRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mirr", rawUrl) + { + } + /// + /// Invoke action mirr + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MirrPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MirrPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mod/ModPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mod/ModPostRequestBody.cs new file mode 100644 index 0000000000..78eb4ed1f0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mod/ModPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mod +{ + #pragma warning disable CS1591 + public class ModPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The divisor property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Divisor { get; set; } +#nullable restore +#else + public Json Divisor { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ModPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ModPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ModPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "divisor", n => { Divisor = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("divisor", Divisor); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mod/ModRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mod/ModRequestBuilder.cs new file mode 100644 index 0000000000..a996fdd314 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mod/ModRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mod +{ + /// + /// Provides operations to call the mod method. + /// + public class ModRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action mod + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action mod"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ModPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ModRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mod", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ModRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mod", rawUrl) + { + } + /// + /// Invoke action mod + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ModPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ModPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Month/MonthPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Month/MonthPostRequestBody.cs new file mode 100644 index 0000000000..d254d9e85e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Month/MonthPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Month +{ + #pragma warning disable CS1591 + public class MonthPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The serialNumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SerialNumber { get; set; } +#nullable restore +#else + public Json SerialNumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MonthPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MonthPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MonthPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "serialNumber", n => { SerialNumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("serialNumber", SerialNumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Month/MonthRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Month/MonthRequestBuilder.cs new file mode 100644 index 0000000000..801c5ab667 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Month/MonthRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Month +{ + /// + /// Provides operations to call the month method. + /// + public class MonthRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action month + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action month"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MonthPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MonthRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/month", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MonthRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/month", rawUrl) + { + } + /// + /// Invoke action month + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MonthPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MonthPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mround/MroundPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mround/MroundPostRequestBody.cs new file mode 100644 index 0000000000..f64e024c06 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mround/MroundPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mround +{ + #pragma warning disable CS1591 + public class MroundPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The multiple property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Multiple { get; set; } +#nullable restore +#else + public Json Multiple { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MroundPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MroundPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MroundPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "multiple", n => { Multiple = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("multiple", Multiple); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mround/MroundRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mround/MroundRequestBuilder.cs new file mode 100644 index 0000000000..8293f408a0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Mround/MroundRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Mround +{ + /// + /// Provides operations to call the mround method. + /// + public class MroundRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action mround + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action mround"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MroundPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MroundRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mround", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MroundRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/mround", rawUrl) + { + } + /// + /// Invoke action mround + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MroundPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MroundPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MultiNomial/MultiNomialPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MultiNomial/MultiNomialPostRequestBody.cs new file mode 100644 index 0000000000..b4511069dd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MultiNomial/MultiNomialPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.MultiNomial +{ + #pragma warning disable CS1591 + public class MultiNomialPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public MultiNomialPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static MultiNomialPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MultiNomialPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MultiNomial/MultiNomialRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MultiNomial/MultiNomialRequestBuilder.cs new file mode 100644 index 0000000000..a3d0ea2fbd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/MultiNomial/MultiNomialRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.MultiNomial +{ + /// + /// Provides operations to call the multiNomial method. + /// + public class MultiNomialRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action multiNomial + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action multiNomial"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(MultiNomialPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MultiNomialRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/multiNomial", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MultiNomialRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/multiNomial", rawUrl) + { + } + /// + /// Invoke action multiNomial + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MultiNomialPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MultiNomialPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/N/NPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/N/NPostRequestBody.cs new file mode 100644 index 0000000000..1ca2d73561 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/N/NPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.N +{ + #pragma warning disable CS1591 + public class NPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static NPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/N/NRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/N/NRequestBuilder.cs new file mode 100644 index 0000000000..83a3bddc03 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/N/NRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.N +{ + /// + /// Provides operations to call the n method. + /// + public class NRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action n + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action n"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(NPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/n", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/n", rawUrl) + { + } + /// + /// Invoke action n + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Na/NaRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Na/NaRequestBuilder.cs new file mode 100644 index 0000000000..ece20489e4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Na/NaRequestBuilder.cs @@ -0,0 +1,102 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Na +{ + /// + /// Provides operations to call the na method. + /// + public class NaRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action na + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action na"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NaRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/na", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NaRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/na", rawUrl) + { + } + /// + /// Invoke action na + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistPostRequestBody.cs new file mode 100644 index 0000000000..24aacde871 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NegBinom_Dist +{ + #pragma warning disable CS1591 + public class NegBinom_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The numberF property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberF { get; set; } +#nullable restore +#else + public Json NumberF { get; set; } +#endif + /// The numberS property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberS { get; set; } +#nullable restore +#else + public Json NumberS { get; set; } +#endif + /// The probabilityS property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ProbabilityS { get; set; } +#nullable restore +#else + public Json ProbabilityS { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NegBinom_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static NegBinom_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NegBinom_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberF", n => { NumberF = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberS", n => { NumberS = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probabilityS", n => { ProbabilityS = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("numberF", NumberF); + writer.WriteObjectValue("numberS", NumberS); + writer.WriteObjectValue("probabilityS", ProbabilityS); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistRequestBuilder.cs new file mode 100644 index 0000000000..ecf43805df --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NegBinom_Dist/NegBinom_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NegBinom_Dist +{ + /// + /// Provides operations to call the negBinom_Dist method. + /// + public class NegBinom_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action negBinom_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action negBinom_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(NegBinom_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NegBinom_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/negBinom_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NegBinom_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/negBinom_Dist", rawUrl) + { + } + /// + /// Invoke action negBinom_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NegBinom_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NegBinom_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays/NetworkDaysPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays/NetworkDaysPostRequestBody.cs new file mode 100644 index 0000000000..3ccedce829 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays/NetworkDaysPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NetworkDays +{ + #pragma warning disable CS1591 + public class NetworkDaysPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndDate { get; set; } +#nullable restore +#else + public Json EndDate { get; set; } +#endif + /// The holidays property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Holidays { get; set; } +#nullable restore +#else + public Json Holidays { get; set; } +#endif + /// The startDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartDate { get; set; } +#nullable restore +#else + public Json StartDate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NetworkDaysPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static NetworkDaysPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NetworkDaysPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endDate", n => { EndDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "holidays", n => { Holidays = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startDate", n => { StartDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endDate", EndDate); + writer.WriteObjectValue("holidays", Holidays); + writer.WriteObjectValue("startDate", StartDate); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays/NetworkDaysRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays/NetworkDaysRequestBuilder.cs new file mode 100644 index 0000000000..39bc4df2c5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays/NetworkDaysRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NetworkDays +{ + /// + /// Provides operations to call the networkDays method. + /// + public class NetworkDaysRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action networkDays + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action networkDays"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(NetworkDaysPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NetworkDaysRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/networkDays", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NetworkDaysRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/networkDays", rawUrl) + { + } + /// + /// Invoke action networkDays + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NetworkDaysPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NetworkDaysPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlPostRequestBody.cs new file mode 100644 index 0000000000..2cf96ba100 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NetworkDays_Intl +{ + #pragma warning disable CS1591 + public class NetworkDays_IntlPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndDate { get; set; } +#nullable restore +#else + public Json EndDate { get; set; } +#endif + /// The holidays property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Holidays { get; set; } +#nullable restore +#else + public Json Holidays { get; set; } +#endif + /// The startDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartDate { get; set; } +#nullable restore +#else + public Json StartDate { get; set; } +#endif + /// The weekend property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Weekend { get; set; } +#nullable restore +#else + public Json Weekend { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NetworkDays_IntlPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static NetworkDays_IntlPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NetworkDays_IntlPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endDate", n => { EndDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "holidays", n => { Holidays = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startDate", n => { StartDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "weekend", n => { Weekend = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endDate", EndDate); + writer.WriteObjectValue("holidays", Holidays); + writer.WriteObjectValue("startDate", StartDate); + writer.WriteObjectValue("weekend", Weekend); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlRequestBuilder.cs new file mode 100644 index 0000000000..26c26bd12a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NetworkDays_Intl/NetworkDays_IntlRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NetworkDays_Intl +{ + /// + /// Provides operations to call the networkDays_Intl method. + /// + public class NetworkDays_IntlRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action networkDays_Intl + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action networkDays_Intl"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(NetworkDays_IntlPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NetworkDays_IntlRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/networkDays_Intl", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NetworkDays_IntlRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/networkDays_Intl", rawUrl) + { + } + /// + /// Invoke action networkDays_Intl + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NetworkDays_IntlPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NetworkDays_IntlPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nominal/NominalPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nominal/NominalPostRequestBody.cs new file mode 100644 index 0000000000..2812e4bf95 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nominal/NominalPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Nominal +{ + #pragma warning disable CS1591 + public class NominalPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The effectRate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EffectRate { get; set; } +#nullable restore +#else + public Json EffectRate { get; set; } +#endif + /// The npery property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Npery { get; set; } +#nullable restore +#else + public Json Npery { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NominalPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static NominalPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NominalPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "effectRate", n => { EffectRate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "npery", n => { Npery = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("effectRate", EffectRate); + writer.WriteObjectValue("npery", Npery); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nominal/NominalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nominal/NominalRequestBuilder.cs new file mode 100644 index 0000000000..f27da31025 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nominal/NominalRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Nominal +{ + /// + /// Provides operations to call the nominal method. + /// + public class NominalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action nominal + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action nominal"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(NominalPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NominalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/nominal", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NominalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/nominal", rawUrl) + { + } + /// + /// Invoke action nominal + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NominalPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NominalPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Dist/Norm_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Dist/Norm_DistPostRequestBody.cs new file mode 100644 index 0000000000..1cadbdfebc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Dist/Norm_DistPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_Dist +{ + #pragma warning disable CS1591 + public class Norm_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The mean property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Mean { get; set; } +#nullable restore +#else + public Json Mean { get; set; } +#endif + /// The standardDev property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StandardDev { get; set; } +#nullable restore +#else + public Json StandardDev { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Norm_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Norm_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Norm_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "mean", n => { Mean = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "standardDev", n => { StandardDev = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("mean", Mean); + writer.WriteObjectValue("standardDev", StandardDev); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Dist/Norm_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Dist/Norm_DistRequestBuilder.cs new file mode 100644 index 0000000000..533df1980e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Dist/Norm_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_Dist +{ + /// + /// Provides operations to call the norm_Dist method. + /// + public class Norm_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action norm_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action norm_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Norm_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Norm_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/norm_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Norm_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/norm_Dist", rawUrl) + { + } + /// + /// Invoke action norm_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Norm_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Norm_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Inv/Norm_InvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Inv/Norm_InvPostRequestBody.cs new file mode 100644 index 0000000000..2e39b10d06 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Inv/Norm_InvPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_Inv +{ + #pragma warning disable CS1591 + public class Norm_InvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The mean property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Mean { get; set; } +#nullable restore +#else + public Json Mean { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// The standardDev property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StandardDev { get; set; } +#nullable restore +#else + public Json StandardDev { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Norm_InvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Norm_InvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Norm_InvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "mean", n => { Mean = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "standardDev", n => { StandardDev = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mean", Mean); + writer.WriteObjectValue("probability", Probability); + writer.WriteObjectValue("standardDev", StandardDev); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Inv/Norm_InvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Inv/Norm_InvRequestBuilder.cs new file mode 100644 index 0000000000..3696e76310 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_Inv/Norm_InvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_Inv +{ + /// + /// Provides operations to call the norm_Inv method. + /// + public class Norm_InvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action norm_Inv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action norm_Inv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Norm_InvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Norm_InvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/norm_Inv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Norm_InvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/norm_Inv", rawUrl) + { + } + /// + /// Invoke action norm_Inv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Norm_InvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Norm_InvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistPostRequestBody.cs new file mode 100644 index 0000000000..c91c4ab6bc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_S_Dist +{ + #pragma warning disable CS1591 + public class Norm_S_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The z property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Z { get; set; } +#nullable restore +#else + public Json Z { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Norm_S_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Norm_S_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Norm_S_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "z", n => { Z = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("z", Z); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistRequestBuilder.cs new file mode 100644 index 0000000000..ee7a1081ce --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Dist/Norm_S_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_S_Dist +{ + /// + /// Provides operations to call the norm_S_Dist method. + /// + public class Norm_S_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action norm_S_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action norm_S_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Norm_S_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Norm_S_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/norm_S_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Norm_S_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/norm_S_Dist", rawUrl) + { + } + /// + /// Invoke action norm_S_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Norm_S_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Norm_S_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvPostRequestBody.cs new file mode 100644 index 0000000000..499ce6dc12 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_S_Inv +{ + #pragma warning disable CS1591 + public class Norm_S_InvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Norm_S_InvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Norm_S_InvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Norm_S_InvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("probability", Probability); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvRequestBuilder.cs new file mode 100644 index 0000000000..2692b56b70 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Norm_S_Inv/Norm_S_InvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Norm_S_Inv +{ + /// + /// Provides operations to call the norm_S_Inv method. + /// + public class Norm_S_InvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action norm_S_Inv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action norm_S_Inv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Norm_S_InvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Norm_S_InvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/norm_S_Inv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Norm_S_InvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/norm_S_Inv", rawUrl) + { + } + /// + /// Invoke action norm_S_Inv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Norm_S_InvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Norm_S_InvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Not/NotPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Not/NotPostRequestBody.cs new file mode 100644 index 0000000000..8411aae9cc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Not/NotPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Not +{ + #pragma warning disable CS1591 + public class NotPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The logical property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Logical { get; set; } +#nullable restore +#else + public Json Logical { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NotPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static NotPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NotPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "logical", n => { Logical = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("logical", Logical); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Not/NotRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Not/NotRequestBuilder.cs new file mode 100644 index 0000000000..5ae2abe7d6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Not/NotRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Not +{ + /// + /// Provides operations to call the not method. + /// + public class NotRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action not + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action not"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(NotPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NotRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/not", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NotRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/not", rawUrl) + { + } + /// + /// Invoke action not + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NotPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NotPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Now/NowRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Now/NowRequestBuilder.cs new file mode 100644 index 0000000000..8df4e9b2b2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Now/NowRequestBuilder.cs @@ -0,0 +1,102 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Now +{ + /// + /// Provides operations to call the now method. + /// + public class NowRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action now + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action now"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NowRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/now", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NowRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/now", rawUrl) + { + } + /// + /// Invoke action now + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nper/NperPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nper/NperPostRequestBody.cs new file mode 100644 index 0000000000..eda31c33dc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nper/NperPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Nper +{ + #pragma warning disable CS1591 + public class NperPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fv { get; set; } +#nullable restore +#else + public Json Fv { get; set; } +#endif + /// The pmt property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pmt { get; set; } +#nullable restore +#else + public Json Pmt { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Type { get; set; } +#nullable restore +#else + public Json Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NperPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static NperPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NperPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fv", n => { Fv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pmt", n => { Pmt = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fv", Fv); + writer.WriteObjectValue("pmt", Pmt); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nper/NperRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nper/NperRequestBuilder.cs new file mode 100644 index 0000000000..f718c3ba5e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Nper/NperRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Nper +{ + /// + /// Provides operations to call the nper method. + /// + public class NperRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action nper + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action nper"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(NperPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NperRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/nper", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NperRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/nper", rawUrl) + { + } + /// + /// Invoke action nper + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NperPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NperPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Npv/NpvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Npv/NpvPostRequestBody.cs new file mode 100644 index 0000000000..64f141752a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Npv/NpvPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Npv +{ + #pragma warning disable CS1591 + public class NpvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NpvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static NpvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NpvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Npv/NpvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Npv/NpvRequestBuilder.cs new file mode 100644 index 0000000000..5fff13d32b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Npv/NpvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Npv +{ + /// + /// Provides operations to call the npv method. + /// + public class NpvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action npv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action npv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(NpvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NpvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/npv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NpvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/npv", rawUrl) + { + } + /// + /// Invoke action npv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NpvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NpvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NumberValue/NumberValuePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NumberValue/NumberValuePostRequestBody.cs new file mode 100644 index 0000000000..597ccf06d2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NumberValue/NumberValuePostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NumberValue +{ + #pragma warning disable CS1591 + public class NumberValuePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The decimalSeparator property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DecimalSeparator { get; set; } +#nullable restore +#else + public Json DecimalSeparator { get; set; } +#endif + /// The groupSeparator property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? GroupSeparator { get; set; } +#nullable restore +#else + public Json GroupSeparator { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NumberValuePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static NumberValuePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NumberValuePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "decimalSeparator", n => { DecimalSeparator = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "groupSeparator", n => { GroupSeparator = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("decimalSeparator", DecimalSeparator); + writer.WriteObjectValue("groupSeparator", GroupSeparator); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NumberValue/NumberValueRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NumberValue/NumberValueRequestBuilder.cs new file mode 100644 index 0000000000..de2986e77f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/NumberValue/NumberValueRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.NumberValue +{ + /// + /// Provides operations to call the numberValue method. + /// + public class NumberValueRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action numberValue + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action numberValue"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(NumberValuePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NumberValueRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/numberValue", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NumberValueRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/numberValue", rawUrl) + { + } + /// + /// Invoke action numberValue + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NumberValuePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NumberValuePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Bin/Oct2BinPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Bin/Oct2BinPostRequestBody.cs new file mode 100644 index 0000000000..0f435cf300 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Bin/Oct2BinPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Oct2Bin +{ + #pragma warning disable CS1591 + public class Oct2BinPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The places property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Places { get; set; } +#nullable restore +#else + public Json Places { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Oct2BinPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Oct2BinPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Oct2BinPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "places", n => { Places = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("places", Places); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Bin/Oct2BinRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Bin/Oct2BinRequestBuilder.cs new file mode 100644 index 0000000000..2cd05c10fe --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Bin/Oct2BinRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Oct2Bin +{ + /// + /// Provides operations to call the oct2Bin method. + /// + public class Oct2BinRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action oct2Bin + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action oct2Bin"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Oct2BinPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Oct2BinRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oct2Bin", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Oct2BinRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oct2Bin", rawUrl) + { + } + /// + /// Invoke action oct2Bin + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Oct2BinPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Oct2BinPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Dec/Oct2DecPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Dec/Oct2DecPostRequestBody.cs new file mode 100644 index 0000000000..c0f77135e0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Dec/Oct2DecPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Oct2Dec +{ + #pragma warning disable CS1591 + public class Oct2DecPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Oct2DecPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Oct2DecPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Oct2DecPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Dec/Oct2DecRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Dec/Oct2DecRequestBuilder.cs new file mode 100644 index 0000000000..686da482c9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Dec/Oct2DecRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Oct2Dec +{ + /// + /// Provides operations to call the oct2Dec method. + /// + public class Oct2DecRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action oct2Dec + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action oct2Dec"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Oct2DecPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Oct2DecRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oct2Dec", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Oct2DecRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oct2Dec", rawUrl) + { + } + /// + /// Invoke action oct2Dec + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Oct2DecPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Oct2DecPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Hex/Oct2HexPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Hex/Oct2HexPostRequestBody.cs new file mode 100644 index 0000000000..a6ec029547 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Hex/Oct2HexPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Oct2Hex +{ + #pragma warning disable CS1591 + public class Oct2HexPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The places property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Places { get; set; } +#nullable restore +#else + public Json Places { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Oct2HexPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Oct2HexPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Oct2HexPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "places", n => { Places = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("places", Places); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Hex/Oct2HexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Hex/Oct2HexRequestBuilder.cs new file mode 100644 index 0000000000..e706b5ab88 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Oct2Hex/Oct2HexRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Oct2Hex +{ + /// + /// Provides operations to call the oct2Hex method. + /// + public class Oct2HexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action oct2Hex + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action oct2Hex"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Oct2HexPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Oct2HexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oct2Hex", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Oct2HexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oct2Hex", rawUrl) + { + } + /// + /// Invoke action oct2Hex + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Oct2HexPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Oct2HexPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Odd/OddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Odd/OddPostRequestBody.cs new file mode 100644 index 0000000000..63dc000561 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Odd/OddPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Odd +{ + #pragma warning disable CS1591 + public class OddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Odd/OddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Odd/OddRequestBuilder.cs new file mode 100644 index 0000000000..3b8613644d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Odd/OddRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Odd +{ + /// + /// Provides operations to call the odd method. + /// + public class OddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action odd + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action odd"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(OddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/odd", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/odd", rawUrl) + { + } + /// + /// Invoke action odd + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFPrice/OddFPricePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFPrice/OddFPricePostRequestBody.cs new file mode 100644 index 0000000000..785d22b79c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFPrice/OddFPricePostRequestBody.cs @@ -0,0 +1,143 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddFPrice +{ + #pragma warning disable CS1591 + public class OddFPricePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The firstCoupon property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FirstCoupon { get; set; } +#nullable restore +#else + public Json FirstCoupon { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The issue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Issue { get; set; } +#nullable restore +#else + public Json Issue { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// The yld property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Yld { get; set; } +#nullable restore +#else + public Json Yld { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OddFPricePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OddFPricePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OddFPricePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "firstCoupon", n => { FirstCoupon = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "issue", n => { Issue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "yld", n => { Yld = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("firstCoupon", FirstCoupon); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("issue", Issue); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteObjectValue("yld", Yld); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFPrice/OddFPriceRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFPrice/OddFPriceRequestBuilder.cs new file mode 100644 index 0000000000..99d4799103 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFPrice/OddFPriceRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddFPrice +{ + /// + /// Provides operations to call the oddFPrice method. + /// + public class OddFPriceRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action oddFPrice + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action oddFPrice"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(OddFPricePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OddFPriceRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oddFPrice", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OddFPriceRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oddFPrice", rawUrl) + { + } + /// + /// Invoke action oddFPrice + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OddFPricePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OddFPricePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFYield/OddFYieldPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFYield/OddFYieldPostRequestBody.cs new file mode 100644 index 0000000000..01267ab990 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFYield/OddFYieldPostRequestBody.cs @@ -0,0 +1,143 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddFYield +{ + #pragma warning disable CS1591 + public class OddFYieldPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The firstCoupon property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FirstCoupon { get; set; } +#nullable restore +#else + public Json FirstCoupon { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The issue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Issue { get; set; } +#nullable restore +#else + public Json Issue { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The pr property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pr { get; set; } +#nullable restore +#else + public Json Pr { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OddFYieldPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OddFYieldPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OddFYieldPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "firstCoupon", n => { FirstCoupon = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "issue", n => { Issue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pr", n => { Pr = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("firstCoupon", FirstCoupon); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("issue", Issue); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("pr", Pr); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFYield/OddFYieldRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFYield/OddFYieldRequestBuilder.cs new file mode 100644 index 0000000000..e9436e85e4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddFYield/OddFYieldRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddFYield +{ + /// + /// Provides operations to call the oddFYield method. + /// + public class OddFYieldRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action oddFYield + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action oddFYield"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(OddFYieldPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OddFYieldRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oddFYield", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OddFYieldRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oddFYield", rawUrl) + { + } + /// + /// Invoke action oddFYield + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OddFYieldPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OddFYieldPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLPrice/OddLPricePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLPrice/OddLPricePostRequestBody.cs new file mode 100644 index 0000000000..ed31ac54c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLPrice/OddLPricePostRequestBody.cs @@ -0,0 +1,133 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddLPrice +{ + #pragma warning disable CS1591 + public class OddLPricePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The lastInterest property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LastInterest { get; set; } +#nullable restore +#else + public Json LastInterest { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// The yld property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Yld { get; set; } +#nullable restore +#else + public Json Yld { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OddLPricePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OddLPricePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OddLPricePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "lastInterest", n => { LastInterest = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "yld", n => { Yld = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("lastInterest", LastInterest); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteObjectValue("yld", Yld); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLPrice/OddLPriceRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLPrice/OddLPriceRequestBuilder.cs new file mode 100644 index 0000000000..a2eba62e12 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLPrice/OddLPriceRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddLPrice +{ + /// + /// Provides operations to call the oddLPrice method. + /// + public class OddLPriceRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action oddLPrice + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action oddLPrice"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(OddLPricePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OddLPriceRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oddLPrice", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OddLPriceRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oddLPrice", rawUrl) + { + } + /// + /// Invoke action oddLPrice + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OddLPricePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OddLPricePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLYield/OddLYieldPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLYield/OddLYieldPostRequestBody.cs new file mode 100644 index 0000000000..9746c3d252 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLYield/OddLYieldPostRequestBody.cs @@ -0,0 +1,133 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddLYield +{ + #pragma warning disable CS1591 + public class OddLYieldPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The lastInterest property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LastInterest { get; set; } +#nullable restore +#else + public Json LastInterest { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The pr property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pr { get; set; } +#nullable restore +#else + public Json Pr { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OddLYieldPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OddLYieldPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OddLYieldPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "lastInterest", n => { LastInterest = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pr", n => { Pr = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("lastInterest", LastInterest); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("pr", Pr); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLYield/OddLYieldRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLYield/OddLYieldRequestBuilder.cs new file mode 100644 index 0000000000..fb07517a0f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/OddLYield/OddLYieldRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.OddLYield +{ + /// + /// Provides operations to call the oddLYield method. + /// + public class OddLYieldRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action oddLYield + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action oddLYield"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(OddLYieldPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OddLYieldRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oddLYield", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OddLYieldRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/oddLYield", rawUrl) + { + } + /// + /// Invoke action oddLYield + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OddLYieldPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OddLYieldPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Or/OrPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Or/OrPostRequestBody.cs new file mode 100644 index 0000000000..b1eca71014 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Or/OrPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Or +{ + #pragma warning disable CS1591 + public class OrPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OrPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OrPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OrPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Or/OrRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Or/OrRequestBuilder.cs new file mode 100644 index 0000000000..1fd4e9a20d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Or/OrRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Or +{ + /// + /// Provides operations to call the or method. + /// + public class OrRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action or + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action or"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(OrPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OrRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/or", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OrRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/or", rawUrl) + { + } + /// + /// Invoke action or + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OrPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OrPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pduration/PdurationPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pduration/PdurationPostRequestBody.cs new file mode 100644 index 0000000000..300721e75d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pduration/PdurationPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pduration +{ + #pragma warning disable CS1591 + public class PdurationPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fv { get; set; } +#nullable restore +#else + public Json Fv { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PdurationPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PdurationPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PdurationPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fv", n => { Fv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fv", Fv); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("rate", Rate); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pduration/PdurationRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pduration/PdurationRequestBuilder.cs new file mode 100644 index 0000000000..a1d53b3b48 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pduration/PdurationRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pduration +{ + /// + /// Provides operations to call the pduration method. + /// + public class PdurationRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action pduration + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action pduration"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PdurationPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PdurationRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/pduration", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PdurationRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/pduration", rawUrl) + { + } + /// + /// Invoke action pduration + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PdurationPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PdurationPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcPostRequestBody.cs new file mode 100644 index 0000000000..e12fb2009d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PercentRank_Exc +{ + #pragma warning disable CS1591 + public class PercentRank_ExcPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The significance property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Significance { get; set; } +#nullable restore +#else + public Json Significance { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PercentRank_ExcPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PercentRank_ExcPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PercentRank_ExcPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "significance", n => { Significance = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("significance", Significance); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcRequestBuilder.cs new file mode 100644 index 0000000000..85249a271b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Exc/PercentRank_ExcRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PercentRank_Exc +{ + /// + /// Provides operations to call the percentRank_Exc method. + /// + public class PercentRank_ExcRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action percentRank_Exc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action percentRank_Exc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PercentRank_ExcPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PercentRank_ExcRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/percentRank_Exc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PercentRank_ExcRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/percentRank_Exc", rawUrl) + { + } + /// + /// Invoke action percentRank_Exc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PercentRank_ExcPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PercentRank_ExcPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncPostRequestBody.cs new file mode 100644 index 0000000000..715ed6879f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PercentRank_Inc +{ + #pragma warning disable CS1591 + public class PercentRank_IncPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The significance property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Significance { get; set; } +#nullable restore +#else + public Json Significance { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PercentRank_IncPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PercentRank_IncPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PercentRank_IncPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "significance", n => { Significance = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("significance", Significance); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncRequestBuilder.cs new file mode 100644 index 0000000000..b8f0796e84 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PercentRank_Inc/PercentRank_IncRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PercentRank_Inc +{ + /// + /// Provides operations to call the percentRank_Inc method. + /// + public class PercentRank_IncRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action percentRank_Inc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action percentRank_Inc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PercentRank_IncPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PercentRank_IncRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/percentRank_Inc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PercentRank_IncRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/percentRank_Inc", rawUrl) + { + } + /// + /// Invoke action percentRank_Inc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PercentRank_IncPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PercentRank_IncPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcPostRequestBody.cs new file mode 100644 index 0000000000..752bb6d5d0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Percentile_Exc +{ + #pragma warning disable CS1591 + public class Percentile_ExcPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The k property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? K { get; set; } +#nullable restore +#else + public Json K { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Percentile_ExcPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Percentile_ExcPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Percentile_ExcPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "k", n => { K = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("k", K); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcRequestBuilder.cs new file mode 100644 index 0000000000..e0e94a1c01 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Exc/Percentile_ExcRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Percentile_Exc +{ + /// + /// Provides operations to call the percentile_Exc method. + /// + public class Percentile_ExcRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action percentile_Exc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action percentile_Exc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Percentile_ExcPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Percentile_ExcRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/percentile_Exc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Percentile_ExcRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/percentile_Exc", rawUrl) + { + } + /// + /// Invoke action percentile_Exc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Percentile_ExcPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Percentile_ExcPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Inc/Percentile_IncPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Inc/Percentile_IncPostRequestBody.cs new file mode 100644 index 0000000000..ef1c42a8a1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Inc/Percentile_IncPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Percentile_Inc +{ + #pragma warning disable CS1591 + public class Percentile_IncPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The k property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? K { get; set; } +#nullable restore +#else + public Json K { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Percentile_IncPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Percentile_IncPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Percentile_IncPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "k", n => { K = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("k", K); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Inc/Percentile_IncRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Inc/Percentile_IncRequestBuilder.cs new file mode 100644 index 0000000000..463dff0849 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Percentile_Inc/Percentile_IncRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Percentile_Inc +{ + /// + /// Provides operations to call the percentile_Inc method. + /// + public class Percentile_IncRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action percentile_Inc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action percentile_Inc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Percentile_IncPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Percentile_IncRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/percentile_Inc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Percentile_IncRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/percentile_Inc", rawUrl) + { + } + /// + /// Invoke action percentile_Inc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Percentile_IncPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Percentile_IncPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permut/PermutPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permut/PermutPostRequestBody.cs new file mode 100644 index 0000000000..f0d9b400c1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permut/PermutPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Permut +{ + #pragma warning disable CS1591 + public class PermutPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The numberChosen property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberChosen { get; set; } +#nullable restore +#else + public Json NumberChosen { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PermutPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PermutPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PermutPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberChosen", n => { NumberChosen = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("numberChosen", NumberChosen); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permut/PermutRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permut/PermutRequestBuilder.cs new file mode 100644 index 0000000000..a275169af9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permut/PermutRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Permut +{ + /// + /// Provides operations to call the permut method. + /// + public class PermutRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action permut + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action permut"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PermutPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PermutRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/permut", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PermutRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/permut", rawUrl) + { + } + /// + /// Invoke action permut + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PermutPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PermutPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permutationa/PermutationaPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permutationa/PermutationaPostRequestBody.cs new file mode 100644 index 0000000000..da6f22d456 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permutationa/PermutationaPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Permutationa +{ + #pragma warning disable CS1591 + public class PermutationaPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The numberChosen property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberChosen { get; set; } +#nullable restore +#else + public Json NumberChosen { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PermutationaPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PermutationaPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PermutationaPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numberChosen", n => { NumberChosen = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("numberChosen", NumberChosen); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permutationa/PermutationaRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permutationa/PermutationaRequestBuilder.cs new file mode 100644 index 0000000000..3d27e1b2b6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Permutationa/PermutationaRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Permutationa +{ + /// + /// Provides operations to call the permutationa method. + /// + public class PermutationaRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action permutationa + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action permutationa"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PermutationaPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PermutationaRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/permutationa", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PermutationaRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/permutationa", rawUrl) + { + } + /// + /// Invoke action permutationa + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PermutationaPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PermutationaPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Phi/PhiPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Phi/PhiPostRequestBody.cs new file mode 100644 index 0000000000..6c02aa05c9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Phi/PhiPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Phi +{ + #pragma warning disable CS1591 + public class PhiPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PhiPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PhiPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PhiPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Phi/PhiRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Phi/PhiRequestBuilder.cs new file mode 100644 index 0000000000..d335975d3f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Phi/PhiRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Phi +{ + /// + /// Provides operations to call the phi method. + /// + public class PhiRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action phi + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action phi"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PhiPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PhiRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/phi", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PhiRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/phi", rawUrl) + { + } + /// + /// Invoke action phi + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PhiPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PhiPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pi/PiRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pi/PiRequestBuilder.cs new file mode 100644 index 0000000000..b017156997 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pi/PiRequestBuilder.cs @@ -0,0 +1,102 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pi +{ + /// + /// Provides operations to call the pi method. + /// + public class PiRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action pi + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action pi"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PiRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/pi", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PiRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/pi", rawUrl) + { + } + /// + /// Invoke action pi + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pmt/PmtPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pmt/PmtPostRequestBody.cs new file mode 100644 index 0000000000..7fc7915544 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pmt/PmtPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pmt +{ + #pragma warning disable CS1591 + public class PmtPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fv { get; set; } +#nullable restore +#else + public Json Fv { get; set; } +#endif + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Type { get; set; } +#nullable restore +#else + public Json Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PmtPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PmtPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PmtPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fv", n => { Fv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fv", Fv); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pmt/PmtRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pmt/PmtRequestBuilder.cs new file mode 100644 index 0000000000..9933944efd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pmt/PmtRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pmt +{ + /// + /// Provides operations to call the pmt method. + /// + public class PmtRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action pmt + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action pmt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PmtPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PmtRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/pmt", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PmtRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/pmt", rawUrl) + { + } + /// + /// Invoke action pmt + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PmtPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PmtPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Poisson_Dist/Poisson_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Poisson_Dist/Poisson_DistPostRequestBody.cs new file mode 100644 index 0000000000..d9ca5c4000 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Poisson_Dist/Poisson_DistPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Poisson_Dist +{ + #pragma warning disable CS1591 + public class Poisson_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The mean property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Mean { get; set; } +#nullable restore +#else + public Json Mean { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Poisson_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Poisson_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Poisson_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "mean", n => { Mean = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("mean", Mean); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Poisson_Dist/Poisson_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Poisson_Dist/Poisson_DistRequestBuilder.cs new file mode 100644 index 0000000000..5384fa0517 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Poisson_Dist/Poisson_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Poisson_Dist +{ + /// + /// Provides operations to call the poisson_Dist method. + /// + public class Poisson_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action poisson_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action poisson_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Poisson_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Poisson_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/poisson_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Poisson_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/poisson_Dist", rawUrl) + { + } + /// + /// Invoke action poisson_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Poisson_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Poisson_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Power/PowerPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Power/PowerPostRequestBody.cs new file mode 100644 index 0000000000..72b3e15514 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Power/PowerPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Power +{ + #pragma warning disable CS1591 + public class PowerPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The power property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Power { get; set; } +#nullable restore +#else + public Json Power { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PowerPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PowerPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PowerPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "power", n => { Power = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("power", Power); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Power/PowerRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Power/PowerRequestBuilder.cs new file mode 100644 index 0000000000..1305c0047d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Power/PowerRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Power +{ + /// + /// Provides operations to call the power method. + /// + public class PowerRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action power + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action power"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PowerPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PowerRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/power", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PowerRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/power", rawUrl) + { + } + /// + /// Invoke action power + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PowerPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PowerPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ppmt/PpmtPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ppmt/PpmtPostRequestBody.cs new file mode 100644 index 0000000000..0274ae0ce1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ppmt/PpmtPostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ppmt +{ + #pragma warning disable CS1591 + public class PpmtPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fv { get; set; } +#nullable restore +#else + public Json Fv { get; set; } +#endif + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The per property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Per { get; set; } +#nullable restore +#else + public Json Per { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Type { get; set; } +#nullable restore +#else + public Json Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PpmtPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PpmtPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PpmtPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fv", n => { Fv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "per", n => { Per = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fv", Fv); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("per", Per); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ppmt/PpmtRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ppmt/PpmtRequestBuilder.cs new file mode 100644 index 0000000000..5e340f4ef6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Ppmt/PpmtRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Ppmt +{ + /// + /// Provides operations to call the ppmt method. + /// + public class PpmtRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action ppmt + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action ppmt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PpmtPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PpmtRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ppmt", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PpmtRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/ppmt", rawUrl) + { + } + /// + /// Invoke action ppmt + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PpmtPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PpmtPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Price/PricePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Price/PricePostRequestBody.cs new file mode 100644 index 0000000000..073b52deda --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Price/PricePostRequestBody.cs @@ -0,0 +1,123 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Price +{ + #pragma warning disable CS1591 + public class PricePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// The yld property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Yld { get; set; } +#nullable restore +#else + public Json Yld { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PricePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PricePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PricePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "yld", n => { Yld = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteObjectValue("yld", Yld); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Price/PriceRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Price/PriceRequestBuilder.cs new file mode 100644 index 0000000000..50ab156bee --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Price/PriceRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Price +{ + /// + /// Provides operations to call the price method. + /// + public class PriceRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action price + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action price"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PricePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PriceRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/price", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PriceRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/price", rawUrl) + { + } + /// + /// Invoke action price + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PricePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PricePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceDisc/PriceDiscPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceDisc/PriceDiscPostRequestBody.cs new file mode 100644 index 0000000000..ad4a0d4ff5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceDisc/PriceDiscPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PriceDisc +{ + #pragma warning disable CS1591 + public class PriceDiscPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The discount property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Discount { get; set; } +#nullable restore +#else + public Json Discount { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PriceDiscPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PriceDiscPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PriceDiscPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "discount", n => { Discount = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("discount", Discount); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceDisc/PriceDiscRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceDisc/PriceDiscRequestBuilder.cs new file mode 100644 index 0000000000..a1d54fc54c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceDisc/PriceDiscRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PriceDisc +{ + /// + /// Provides operations to call the priceDisc method. + /// + public class PriceDiscRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action priceDisc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action priceDisc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PriceDiscPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PriceDiscRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/priceDisc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PriceDiscRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/priceDisc", rawUrl) + { + } + /// + /// Invoke action priceDisc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PriceDiscPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PriceDiscPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceMat/PriceMatPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceMat/PriceMatPostRequestBody.cs new file mode 100644 index 0000000000..70c95e1d00 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceMat/PriceMatPostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PriceMat +{ + #pragma warning disable CS1591 + public class PriceMatPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The issue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Issue { get; set; } +#nullable restore +#else + public Json Issue { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// The yld property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Yld { get; set; } +#nullable restore +#else + public Json Yld { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PriceMatPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PriceMatPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PriceMatPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "issue", n => { Issue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "yld", n => { Yld = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("issue", Issue); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteObjectValue("yld", Yld); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceMat/PriceMatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceMat/PriceMatRequestBuilder.cs new file mode 100644 index 0000000000..649dc329c8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/PriceMat/PriceMatRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.PriceMat +{ + /// + /// Provides operations to call the priceMat method. + /// + public class PriceMatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action priceMat + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action priceMat"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PriceMatPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PriceMatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/priceMat", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PriceMatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/priceMat", rawUrl) + { + } + /// + /// Invoke action priceMat + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PriceMatPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PriceMatPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Product/ProductPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Product/ProductPostRequestBody.cs new file mode 100644 index 0000000000..dba13184d9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Product/ProductPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Product +{ + #pragma warning disable CS1591 + public class ProductPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ProductPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ProductPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ProductPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Product/ProductRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Product/ProductRequestBuilder.cs new file mode 100644 index 0000000000..b3b5142a69 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Product/ProductRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Product +{ + /// + /// Provides operations to call the product method. + /// + public class ProductRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action product + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action product"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ProductPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ProductRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/product", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ProductRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/product", rawUrl) + { + } + /// + /// Invoke action product + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ProductPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ProductPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Proper/ProperPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Proper/ProperPostRequestBody.cs new file mode 100644 index 0000000000..05831763de --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Proper/ProperPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Proper +{ + #pragma warning disable CS1591 + public class ProperPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ProperPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ProperPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ProperPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Proper/ProperRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Proper/ProperRequestBuilder.cs new file mode 100644 index 0000000000..6d16516fb6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Proper/ProperRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Proper +{ + /// + /// Provides operations to call the proper method. + /// + public class ProperRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action proper + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action proper"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ProperPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ProperRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/proper", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ProperRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/proper", rawUrl) + { + } + /// + /// Invoke action proper + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ProperPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ProperPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pv/PvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pv/PvPostRequestBody.cs new file mode 100644 index 0000000000..05c9ff4e51 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pv/PvPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pv +{ + #pragma warning disable CS1591 + public class PvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fv { get; set; } +#nullable restore +#else + public Json Fv { get; set; } +#endif + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The pmt property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pmt { get; set; } +#nullable restore +#else + public Json Pmt { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Type { get; set; } +#nullable restore +#else + public Json Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static PvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fv", n => { Fv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pmt", n => { Pmt = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fv", Fv); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("pmt", Pmt); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pv/PvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pv/PvRequestBuilder.cs new file mode 100644 index 0000000000..d15dc595fc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Pv/PvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Pv +{ + /// + /// Provides operations to call the pv method. + /// + public class PvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action pv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action pv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(PvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/pv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/pv", rawUrl) + { + } + /// + /// Invoke action pv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcPostRequestBody.cs new file mode 100644 index 0000000000..55ea73baa2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Quartile_Exc +{ + #pragma warning disable CS1591 + public class Quartile_ExcPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The quart property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Quart { get; set; } +#nullable restore +#else + public Json Quart { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Quartile_ExcPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Quartile_ExcPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Quartile_ExcPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "quart", n => { Quart = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("quart", Quart); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcRequestBuilder.cs new file mode 100644 index 0000000000..e2b11d87f4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Exc/Quartile_ExcRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Quartile_Exc +{ + /// + /// Provides operations to call the quartile_Exc method. + /// + public class Quartile_ExcRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action quartile_Exc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action quartile_Exc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Quartile_ExcPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Quartile_ExcRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/quartile_Exc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Quartile_ExcRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/quartile_Exc", rawUrl) + { + } + /// + /// Invoke action quartile_Exc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Quartile_ExcPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Quartile_ExcPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Inc/Quartile_IncPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Inc/Quartile_IncPostRequestBody.cs new file mode 100644 index 0000000000..7293d6acd2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Inc/Quartile_IncPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Quartile_Inc +{ + #pragma warning disable CS1591 + public class Quartile_IncPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The quart property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Quart { get; set; } +#nullable restore +#else + public Json Quart { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Quartile_IncPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Quartile_IncPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Quartile_IncPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "quart", n => { Quart = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("quart", Quart); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Inc/Quartile_IncRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Inc/Quartile_IncRequestBuilder.cs new file mode 100644 index 0000000000..6a4704a788 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quartile_Inc/Quartile_IncRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Quartile_Inc +{ + /// + /// Provides operations to call the quartile_Inc method. + /// + public class Quartile_IncRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action quartile_Inc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action quartile_Inc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Quartile_IncPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Quartile_IncRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/quartile_Inc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Quartile_IncRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/quartile_Inc", rawUrl) + { + } + /// + /// Invoke action quartile_Inc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Quartile_IncPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Quartile_IncPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quotient/QuotientPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quotient/QuotientPostRequestBody.cs new file mode 100644 index 0000000000..1b43608277 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quotient/QuotientPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Quotient +{ + #pragma warning disable CS1591 + public class QuotientPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The denominator property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Denominator { get; set; } +#nullable restore +#else + public Json Denominator { get; set; } +#endif + /// The numerator property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Numerator { get; set; } +#nullable restore +#else + public Json Numerator { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public QuotientPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static QuotientPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new QuotientPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "denominator", n => { Denominator = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numerator", n => { Numerator = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("denominator", Denominator); + writer.WriteObjectValue("numerator", Numerator); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quotient/QuotientRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quotient/QuotientRequestBuilder.cs new file mode 100644 index 0000000000..0c5140d53c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Quotient/QuotientRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Quotient +{ + /// + /// Provides operations to call the quotient method. + /// + public class QuotientRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action quotient + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action quotient"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(QuotientPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public QuotientRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/quotient", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public QuotientRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/quotient", rawUrl) + { + } + /// + /// Invoke action quotient + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(QuotientPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(QuotientPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Radians/RadiansPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Radians/RadiansPostRequestBody.cs new file mode 100644 index 0000000000..357dc2220f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Radians/RadiansPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Radians +{ + #pragma warning disable CS1591 + public class RadiansPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The angle property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Angle { get; set; } +#nullable restore +#else + public Json Angle { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RadiansPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RadiansPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RadiansPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "angle", n => { Angle = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("angle", Angle); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Radians/RadiansRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Radians/RadiansRequestBuilder.cs new file mode 100644 index 0000000000..765ecb63c4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Radians/RadiansRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Radians +{ + /// + /// Provides operations to call the radians method. + /// + public class RadiansRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action radians + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action radians"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RadiansPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RadiansRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/radians", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RadiansRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/radians", rawUrl) + { + } + /// + /// Invoke action radians + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RadiansPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RadiansPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rand/RandRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rand/RandRequestBuilder.cs new file mode 100644 index 0000000000..7ba68963a1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rand/RandRequestBuilder.cs @@ -0,0 +1,102 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rand +{ + /// + /// Provides operations to call the rand method. + /// + public class RandRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action rand + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action rand"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RandRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rand", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RandRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rand", rawUrl) + { + } + /// + /// Invoke action rand + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RandBetween/RandBetweenPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RandBetween/RandBetweenPostRequestBody.cs new file mode 100644 index 0000000000..f5538c8cdd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RandBetween/RandBetweenPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.RandBetween +{ + #pragma warning disable CS1591 + public class RandBetweenPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The bottom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Bottom { get; set; } +#nullable restore +#else + public Json Bottom { get; set; } +#endif + /// The top property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Top { get; set; } +#nullable restore +#else + public Json Top { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RandBetweenPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RandBetweenPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RandBetweenPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "bottom", n => { Bottom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "top", n => { Top = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("bottom", Bottom); + writer.WriteObjectValue("top", Top); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RandBetween/RandBetweenRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RandBetween/RandBetweenRequestBuilder.cs new file mode 100644 index 0000000000..5f4d1bff73 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RandBetween/RandBetweenRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.RandBetween +{ + /// + /// Provides operations to call the randBetween method. + /// + public class RandBetweenRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action randBetween + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action randBetween"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RandBetweenPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RandBetweenRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/randBetween", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RandBetweenRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/randBetween", rawUrl) + { + } + /// + /// Invoke action randBetween + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RandBetweenPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RandBetweenPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Avg/Rank_AvgPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Avg/Rank_AvgPostRequestBody.cs new file mode 100644 index 0000000000..455e254691 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Avg/Rank_AvgPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rank_Avg +{ + #pragma warning disable CS1591 + public class Rank_AvgPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The order property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Order { get; set; } +#nullable restore +#else + public Json Order { get; set; } +#endif + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Ref { get; set; } +#nullable restore +#else + public Json Ref { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Rank_AvgPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Rank_AvgPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Rank_AvgPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "order", n => { Order = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "ref", n => { Ref = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("order", Order); + writer.WriteObjectValue("ref", Ref); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Avg/Rank_AvgRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Avg/Rank_AvgRequestBuilder.cs new file mode 100644 index 0000000000..899507e568 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Avg/Rank_AvgRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rank_Avg +{ + /// + /// Provides operations to call the rank_Avg method. + /// + public class Rank_AvgRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action rank_Avg + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action rank_Avg"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Rank_AvgPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Rank_AvgRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rank_Avg", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Rank_AvgRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rank_Avg", rawUrl) + { + } + /// + /// Invoke action rank_Avg + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Rank_AvgPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Rank_AvgPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Eq/Rank_EqPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Eq/Rank_EqPostRequestBody.cs new file mode 100644 index 0000000000..c54ee119e7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Eq/Rank_EqPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rank_Eq +{ + #pragma warning disable CS1591 + public class Rank_EqPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The order property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Order { get; set; } +#nullable restore +#else + public Json Order { get; set; } +#endif + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Ref { get; set; } +#nullable restore +#else + public Json Ref { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Rank_EqPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Rank_EqPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Rank_EqPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "order", n => { Order = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "ref", n => { Ref = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("order", Order); + writer.WriteObjectValue("ref", Ref); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Eq/Rank_EqRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Eq/Rank_EqRequestBuilder.cs new file mode 100644 index 0000000000..76af021db3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rank_Eq/Rank_EqRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rank_Eq +{ + /// + /// Provides operations to call the rank_Eq method. + /// + public class Rank_EqRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action rank_Eq + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action rank_Eq"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Rank_EqPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Rank_EqRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rank_Eq", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Rank_EqRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rank_Eq", rawUrl) + { + } + /// + /// Invoke action rank_Eq + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Rank_EqPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Rank_EqPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rate/RatePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rate/RatePostRequestBody.cs new file mode 100644 index 0000000000..a574fdfe0a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rate/RatePostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rate +{ + #pragma warning disable CS1591 + public class RatePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fv { get; set; } +#nullable restore +#else + public Json Fv { get; set; } +#endif + /// The guess property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Guess { get; set; } +#nullable restore +#else + public Json Guess { get; set; } +#endif + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The pmt property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pmt { get; set; } +#nullable restore +#else + public Json Pmt { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Type { get; set; } +#nullable restore +#else + public Json Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RatePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RatePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RatePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fv", n => { Fv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "guess", n => { Guess = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pmt", n => { Pmt = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fv", Fv); + writer.WriteObjectValue("guess", Guess); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("pmt", Pmt); + writer.WriteObjectValue("pv", Pv); + writer.WriteObjectValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rate/RateRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rate/RateRequestBuilder.cs new file mode 100644 index 0000000000..5bd1c9c709 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rate/RateRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rate +{ + /// + /// Provides operations to call the rate method. + /// + public class RateRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action rate + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action rate"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RatePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RateRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rate", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RateRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rate", rawUrl) + { + } + /// + /// Invoke action rate + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RatePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RatePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Received/ReceivedPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Received/ReceivedPostRequestBody.cs new file mode 100644 index 0000000000..990aba6c0e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Received/ReceivedPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Received +{ + #pragma warning disable CS1591 + public class ReceivedPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The discount property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Discount { get; set; } +#nullable restore +#else + public Json Discount { get; set; } +#endif + /// The investment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Investment { get; set; } +#nullable restore +#else + public Json Investment { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ReceivedPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ReceivedPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ReceivedPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "discount", n => { Discount = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "investment", n => { Investment = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("discount", Discount); + writer.WriteObjectValue("investment", Investment); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Received/ReceivedRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Received/ReceivedRequestBuilder.cs new file mode 100644 index 0000000000..2a0a98ee9d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Received/ReceivedRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Received +{ + /// + /// Provides operations to call the received method. + /// + public class ReceivedRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action received + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action received"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ReceivedPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReceivedRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/received", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReceivedRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/received", rawUrl) + { + } + /// + /// Invoke action received + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ReceivedPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ReceivedPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Replace/ReplacePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Replace/ReplacePostRequestBody.cs new file mode 100644 index 0000000000..2067844a6f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Replace/ReplacePostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Replace +{ + #pragma warning disable CS1591 + public class ReplacePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The newText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NewText { get; set; } +#nullable restore +#else + public Json NewText { get; set; } +#endif + /// The numChars property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumChars { get; set; } +#nullable restore +#else + public Json NumChars { get; set; } +#endif + /// The oldText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? OldText { get; set; } +#nullable restore +#else + public Json OldText { get; set; } +#endif + /// The startNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartNum { get; set; } +#nullable restore +#else + public Json StartNum { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ReplacePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ReplacePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ReplacePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "newText", n => { NewText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numChars", n => { NumChars = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "oldText", n => { OldText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startNum", n => { StartNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("newText", NewText); + writer.WriteObjectValue("numChars", NumChars); + writer.WriteObjectValue("oldText", OldText); + writer.WriteObjectValue("startNum", StartNum); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Replace/ReplaceRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Replace/ReplaceRequestBuilder.cs new file mode 100644 index 0000000000..0c576a2d97 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Replace/ReplaceRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Replace +{ + /// + /// Provides operations to call the replace method. + /// + public class ReplaceRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action replace + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action replace"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ReplacePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReplaceRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/replace", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReplaceRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/replace", rawUrl) + { + } + /// + /// Invoke action replace + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ReplacePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ReplacePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ReplaceB/ReplaceBPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ReplaceB/ReplaceBPostRequestBody.cs new file mode 100644 index 0000000000..5378f14923 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ReplaceB/ReplaceBPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ReplaceB +{ + #pragma warning disable CS1591 + public class ReplaceBPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The newText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NewText { get; set; } +#nullable restore +#else + public Json NewText { get; set; } +#endif + /// The numBytes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumBytes { get; set; } +#nullable restore +#else + public Json NumBytes { get; set; } +#endif + /// The oldText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? OldText { get; set; } +#nullable restore +#else + public Json OldText { get; set; } +#endif + /// The startNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartNum { get; set; } +#nullable restore +#else + public Json StartNum { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ReplaceBPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ReplaceBPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ReplaceBPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "newText", n => { NewText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "numBytes", n => { NumBytes = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "oldText", n => { OldText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startNum", n => { StartNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("newText", NewText); + writer.WriteObjectValue("numBytes", NumBytes); + writer.WriteObjectValue("oldText", OldText); + writer.WriteObjectValue("startNum", StartNum); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ReplaceB/ReplaceBRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ReplaceB/ReplaceBRequestBuilder.cs new file mode 100644 index 0000000000..9bb851dce6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/ReplaceB/ReplaceBRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.ReplaceB +{ + /// + /// Provides operations to call the replaceB method. + /// + public class ReplaceBRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action replaceB + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action replaceB"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ReplaceBPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReplaceBRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/replaceB", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReplaceBRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/replaceB", rawUrl) + { + } + /// + /// Invoke action replaceB + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ReplaceBPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ReplaceBPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rept/ReptPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rept/ReptPostRequestBody.cs new file mode 100644 index 0000000000..e522cac0c5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rept/ReptPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rept +{ + #pragma warning disable CS1591 + public class ReptPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The numberTimes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumberTimes { get; set; } +#nullable restore +#else + public Json NumberTimes { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ReptPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ReptPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ReptPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numberTimes", n => { NumberTimes = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("numberTimes", NumberTimes); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rept/ReptRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rept/ReptRequestBuilder.cs new file mode 100644 index 0000000000..73fe809495 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rept/ReptRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rept +{ + /// + /// Provides operations to call the rept method. + /// + public class ReptRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action rept + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action rept"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ReptPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReptRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rept", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReptRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rept", rawUrl) + { + } + /// + /// Invoke action rept + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ReptPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ReptPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Right/RightPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Right/RightPostRequestBody.cs new file mode 100644 index 0000000000..4e48e76fcf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Right/RightPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Right +{ + #pragma warning disable CS1591 + public class RightPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The numChars property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumChars { get; set; } +#nullable restore +#else + public Json NumChars { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RightPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RightPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RightPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numChars", n => { NumChars = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("numChars", NumChars); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Right/RightRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Right/RightRequestBuilder.cs new file mode 100644 index 0000000000..2cb6d94ca4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Right/RightRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Right +{ + /// + /// Provides operations to call the right method. + /// + public class RightRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action right + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action right"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RightPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RightRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/right", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RightRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/right", rawUrl) + { + } + /// + /// Invoke action right + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RightPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RightPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rightb/RightbPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rightb/RightbPostRequestBody.cs new file mode 100644 index 0000000000..2562171233 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rightb/RightbPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rightb +{ + #pragma warning disable CS1591 + public class RightbPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The numBytes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumBytes { get; set; } +#nullable restore +#else + public Json NumBytes { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RightbPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RightbPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RightbPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numBytes", n => { NumBytes = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("numBytes", NumBytes); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rightb/RightbRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rightb/RightbRequestBuilder.cs new file mode 100644 index 0000000000..005e591d30 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rightb/RightbRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rightb +{ + /// + /// Provides operations to call the rightb method. + /// + public class RightbRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action rightb + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action rightb"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RightbPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RightbRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rightb", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RightbRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rightb", rawUrl) + { + } + /// + /// Invoke action rightb + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RightbPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RightbPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Roman/RomanPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Roman/RomanPostRequestBody.cs new file mode 100644 index 0000000000..8b6b8af181 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Roman/RomanPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Roman +{ + #pragma warning disable CS1591 + public class RomanPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The form property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Form { get; set; } +#nullable restore +#else + public Json Form { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RomanPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RomanPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RomanPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "form", n => { Form = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("form", Form); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Roman/RomanRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Roman/RomanRequestBuilder.cs new file mode 100644 index 0000000000..724554b412 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Roman/RomanRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Roman +{ + /// + /// Provides operations to call the roman method. + /// + public class RomanRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action roman + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action roman"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RomanPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RomanRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/roman", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RomanRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/roman", rawUrl) + { + } + /// + /// Invoke action roman + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RomanPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RomanPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Round/RoundPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Round/RoundPostRequestBody.cs new file mode 100644 index 0000000000..c1d77c12da --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Round/RoundPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Round +{ + #pragma warning disable CS1591 + public class RoundPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The numDigits property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumDigits { get; set; } +#nullable restore +#else + public Json NumDigits { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RoundPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RoundPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RoundPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numDigits", n => { NumDigits = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("numDigits", NumDigits); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Round/RoundRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Round/RoundRequestBuilder.cs new file mode 100644 index 0000000000..3fa533f858 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Round/RoundRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Round +{ + /// + /// Provides operations to call the round method. + /// + public class RoundRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action round + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action round"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RoundPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RoundRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/round", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RoundRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/round", rawUrl) + { + } + /// + /// Invoke action round + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RoundPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RoundPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundDown/RoundDownPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundDown/RoundDownPostRequestBody.cs new file mode 100644 index 0000000000..7616701e09 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundDown/RoundDownPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.RoundDown +{ + #pragma warning disable CS1591 + public class RoundDownPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The numDigits property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumDigits { get; set; } +#nullable restore +#else + public Json NumDigits { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RoundDownPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RoundDownPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RoundDownPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numDigits", n => { NumDigits = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("numDigits", NumDigits); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundDown/RoundDownRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundDown/RoundDownRequestBuilder.cs new file mode 100644 index 0000000000..934590bfae --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundDown/RoundDownRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.RoundDown +{ + /// + /// Provides operations to call the roundDown method. + /// + public class RoundDownRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action roundDown + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action roundDown"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RoundDownPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RoundDownRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/roundDown", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RoundDownRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/roundDown", rawUrl) + { + } + /// + /// Invoke action roundDown + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RoundDownPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RoundDownPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundUp/RoundUpPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundUp/RoundUpPostRequestBody.cs new file mode 100644 index 0000000000..e09624be73 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundUp/RoundUpPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.RoundUp +{ + #pragma warning disable CS1591 + public class RoundUpPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The numDigits property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumDigits { get; set; } +#nullable restore +#else + public Json NumDigits { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RoundUpPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RoundUpPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RoundUpPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numDigits", n => { NumDigits = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("numDigits", NumDigits); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundUp/RoundUpRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundUp/RoundUpRequestBuilder.cs new file mode 100644 index 0000000000..63a29659d2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/RoundUp/RoundUpRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.RoundUp +{ + /// + /// Provides operations to call the roundUp method. + /// + public class RoundUpRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action roundUp + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action roundUp"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RoundUpPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RoundUpRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/roundUp", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RoundUpRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/roundUp", rawUrl) + { + } + /// + /// Invoke action roundUp + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RoundUpPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RoundUpPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rows/RowsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rows/RowsPostRequestBody.cs new file mode 100644 index 0000000000..4dbc2879e5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rows/RowsPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rows +{ + #pragma warning disable CS1591 + public class RowsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RowsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RowsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RowsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rows/RowsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rows/RowsRequestBuilder.cs new file mode 100644 index 0000000000..21f334de7f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rows/RowsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rows +{ + /// + /// Provides operations to call the rows method. + /// + public class RowsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action rows + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action rows"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RowsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RowsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rows", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RowsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rows", rawUrl) + { + } + /// + /// Invoke action rows + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RowsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RowsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rri/RriPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rri/RriPostRequestBody.cs new file mode 100644 index 0000000000..d5f2c39803 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rri/RriPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rri +{ + #pragma warning disable CS1591 + public class RriPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Fv { get; set; } +#nullable restore +#else + public Json Fv { get; set; } +#endif + /// The nper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Nper { get; set; } +#nullable restore +#else + public Json Nper { get; set; } +#endif + /// The pv property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pv { get; set; } +#nullable restore +#else + public Json Pv { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RriPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static RriPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RriPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fv", n => { Fv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "nper", n => { Nper = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pv", n => { Pv = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("fv", Fv); + writer.WriteObjectValue("nper", Nper); + writer.WriteObjectValue("pv", Pv); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rri/RriRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rri/RriRequestBuilder.cs new file mode 100644 index 0000000000..748142d6b7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Rri/RriRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Rri +{ + /// + /// Provides operations to call the rri method. + /// + public class RriRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action rri + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action rri"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RriPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RriRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rri", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RriRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/rri", rawUrl) + { + } + /// + /// Invoke action rri + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RriPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RriPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sec/SecPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sec/SecPostRequestBody.cs new file mode 100644 index 0000000000..9dc3321a0b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sec/SecPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sec +{ + #pragma warning disable CS1591 + public class SecPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SecPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SecPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SecPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sec/SecRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sec/SecRequestBuilder.cs new file mode 100644 index 0000000000..e4692ed55f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sec/SecRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sec +{ + /// + /// Provides operations to call the sec method. + /// + public class SecRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sec + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sec"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SecPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SecRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sec", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SecRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sec", rawUrl) + { + } + /// + /// Invoke action sec + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SecPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SecPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sech/SechPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sech/SechPostRequestBody.cs new file mode 100644 index 0000000000..2b47927877 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sech/SechPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sech +{ + #pragma warning disable CS1591 + public class SechPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SechPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SechPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SechPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sech/SechRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sech/SechRequestBuilder.cs new file mode 100644 index 0000000000..b26c130f6c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sech/SechRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sech +{ + /// + /// Provides operations to call the sech method. + /// + public class SechRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sech + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sech"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SechPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SechRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sech", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SechRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sech", rawUrl) + { + } + /// + /// Invoke action sech + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SechPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SechPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Second/SecondPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Second/SecondPostRequestBody.cs new file mode 100644 index 0000000000..70556d7558 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Second/SecondPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Second +{ + #pragma warning disable CS1591 + public class SecondPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The serialNumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SerialNumber { get; set; } +#nullable restore +#else + public Json SerialNumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SecondPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SecondPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SecondPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "serialNumber", n => { SerialNumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("serialNumber", SerialNumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Second/SecondRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Second/SecondRequestBuilder.cs new file mode 100644 index 0000000000..3698ed6628 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Second/SecondRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Second +{ + /// + /// Provides operations to call the second method. + /// + public class SecondRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action second + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action second"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SecondPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SecondRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/second", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SecondRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/second", rawUrl) + { + } + /// + /// Invoke action second + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SecondPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SecondPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SeriesSum/SeriesSumPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SeriesSum/SeriesSumPostRequestBody.cs new file mode 100644 index 0000000000..95b655ae39 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SeriesSum/SeriesSumPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SeriesSum +{ + #pragma warning disable CS1591 + public class SeriesSumPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The coefficients property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Coefficients { get; set; } +#nullable restore +#else + public Json Coefficients { get; set; } +#endif + /// The m property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? M { get; set; } +#nullable restore +#else + public Json M { get; set; } +#endif + /// The n property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? N { get; set; } +#nullable restore +#else + public Json N { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SeriesSumPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SeriesSumPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SeriesSumPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "coefficients", n => { Coefficients = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "m", n => { M = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "n", n => { N = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("coefficients", Coefficients); + writer.WriteObjectValue("m", M); + writer.WriteObjectValue("n", N); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SeriesSum/SeriesSumRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SeriesSum/SeriesSumRequestBuilder.cs new file mode 100644 index 0000000000..57414ba82f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SeriesSum/SeriesSumRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SeriesSum +{ + /// + /// Provides operations to call the seriesSum method. + /// + public class SeriesSumRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action seriesSum + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action seriesSum"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SeriesSumPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SeriesSumRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/seriesSum", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SeriesSumRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/seriesSum", rawUrl) + { + } + /// + /// Invoke action seriesSum + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SeriesSumPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SeriesSumPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheet/SheetPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheet/SheetPostRequestBody.cs new file mode 100644 index 0000000000..f3d00dd86b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheet/SheetPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sheet +{ + #pragma warning disable CS1591 + public class SheetPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SheetPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SheetPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SheetPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheet/SheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheet/SheetRequestBuilder.cs new file mode 100644 index 0000000000..3467a1e05a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheet/SheetRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sheet +{ + /// + /// Provides operations to call the sheet method. + /// + public class SheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sheet + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sheet"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SheetPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sheet", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sheet", rawUrl) + { + } + /// + /// Invoke action sheet + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SheetPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SheetPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheets/SheetsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheets/SheetsPostRequestBody.cs new file mode 100644 index 0000000000..209558e57b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheets/SheetsPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sheets +{ + #pragma warning disable CS1591 + public class SheetsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The reference property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Reference { get; set; } +#nullable restore +#else + public Json Reference { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SheetsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SheetsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SheetsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "reference", n => { Reference = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("reference", Reference); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheets/SheetsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheets/SheetsRequestBuilder.cs new file mode 100644 index 0000000000..1f12b8366e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sheets/SheetsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sheets +{ + /// + /// Provides operations to call the sheets method. + /// + public class SheetsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sheets + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sheets"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SheetsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SheetsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sheets", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SheetsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sheets", rawUrl) + { + } + /// + /// Invoke action sheets + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SheetsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SheetsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sign/SignPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sign/SignPostRequestBody.cs new file mode 100644 index 0000000000..4595928328 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sign/SignPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sign +{ + #pragma warning disable CS1591 + public class SignPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SignPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SignPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SignPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sign/SignRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sign/SignRequestBuilder.cs new file mode 100644 index 0000000000..ca244315e4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sign/SignRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sign +{ + /// + /// Provides operations to call the sign method. + /// + public class SignRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sign + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sign"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SignPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SignRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sign", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SignRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sign", rawUrl) + { + } + /// + /// Invoke action sign + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SignPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SignPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sin/SinPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sin/SinPostRequestBody.cs new file mode 100644 index 0000000000..9fc00f1f3e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sin/SinPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sin +{ + #pragma warning disable CS1591 + public class SinPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SinPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SinPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SinPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sin/SinRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sin/SinRequestBuilder.cs new file mode 100644 index 0000000000..342c437c5c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sin/SinRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sin +{ + /// + /// Provides operations to call the sin method. + /// + public class SinRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sin + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sin"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SinPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SinRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sin", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SinRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sin", rawUrl) + { + } + /// + /// Invoke action sin + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SinPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SinPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sinh/SinhPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sinh/SinhPostRequestBody.cs new file mode 100644 index 0000000000..6d2b13c0fb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sinh/SinhPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sinh +{ + #pragma warning disable CS1591 + public class SinhPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SinhPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SinhPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SinhPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sinh/SinhRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sinh/SinhRequestBuilder.cs new file mode 100644 index 0000000000..264c9054ff --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sinh/SinhRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sinh +{ + /// + /// Provides operations to call the sinh method. + /// + public class SinhRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sinh + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sinh"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SinhPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SinhRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sinh", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SinhRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sinh", rawUrl) + { + } + /// + /// Invoke action sinh + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SinhPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SinhPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew/SkewPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew/SkewPostRequestBody.cs new file mode 100644 index 0000000000..50d3a0f4d6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew/SkewPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Skew +{ + #pragma warning disable CS1591 + public class SkewPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SkewPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SkewPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SkewPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew/SkewRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew/SkewRequestBuilder.cs new file mode 100644 index 0000000000..5119c4663f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew/SkewRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Skew +{ + /// + /// Provides operations to call the skew method. + /// + public class SkewRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action skew + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action skew"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SkewPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SkewRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/skew", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SkewRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/skew", rawUrl) + { + } + /// + /// Invoke action skew + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SkewPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SkewPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew_p/Skew_pPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew_p/Skew_pPostRequestBody.cs new file mode 100644 index 0000000000..275dd8c176 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew_p/Skew_pPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Skew_p +{ + #pragma warning disable CS1591 + public class Skew_pPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Skew_pPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Skew_pPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Skew_pPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew_p/Skew_pRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew_p/Skew_pRequestBuilder.cs new file mode 100644 index 0000000000..d9a892532c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Skew_p/Skew_pRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Skew_p +{ + /// + /// Provides operations to call the skew_p method. + /// + public class Skew_pRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action skew_p + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action skew_p"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Skew_pPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Skew_pRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/skew_p", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Skew_pRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/skew_p", rawUrl) + { + } + /// + /// Invoke action skew_p + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Skew_pPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Skew_pPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sln/SlnPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sln/SlnPostRequestBody.cs new file mode 100644 index 0000000000..03e866f00b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sln/SlnPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sln +{ + #pragma warning disable CS1591 + public class SlnPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cost property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cost { get; set; } +#nullable restore +#else + public Json Cost { get; set; } +#endif + /// The life property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Life { get; set; } +#nullable restore +#else + public Json Life { get; set; } +#endif + /// The salvage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Salvage { get; set; } +#nullable restore +#else + public Json Salvage { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SlnPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SlnPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SlnPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cost", n => { Cost = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "life", n => { Life = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "salvage", n => { Salvage = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cost", Cost); + writer.WriteObjectValue("life", Life); + writer.WriteObjectValue("salvage", Salvage); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sln/SlnRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sln/SlnRequestBuilder.cs new file mode 100644 index 0000000000..9f84bab801 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sln/SlnRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sln +{ + /// + /// Provides operations to call the sln method. + /// + public class SlnRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sln + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sln"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SlnPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SlnRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sln", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SlnRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sln", rawUrl) + { + } + /// + /// Invoke action sln + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SlnPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SlnPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Small/SmallPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Small/SmallPostRequestBody.cs new file mode 100644 index 0000000000..fd2b780106 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Small/SmallPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Small +{ + #pragma warning disable CS1591 + public class SmallPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The k property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? K { get; set; } +#nullable restore +#else + public Json K { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SmallPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SmallPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SmallPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "k", n => { K = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("k", K); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Small/SmallRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Small/SmallRequestBuilder.cs new file mode 100644 index 0000000000..a1e5484c6f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Small/SmallRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Small +{ + /// + /// Provides operations to call the small method. + /// + public class SmallRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action small + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action small"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SmallPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SmallRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/small", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SmallRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/small", rawUrl) + { + } + /// + /// Invoke action small + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SmallPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SmallPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sqrt/SqrtPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sqrt/SqrtPostRequestBody.cs new file mode 100644 index 0000000000..3a89aad56a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sqrt/SqrtPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sqrt +{ + #pragma warning disable CS1591 + public class SqrtPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SqrtPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SqrtPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SqrtPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sqrt/SqrtRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sqrt/SqrtRequestBuilder.cs new file mode 100644 index 0000000000..757a2ea38f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sqrt/SqrtRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sqrt +{ + /// + /// Provides operations to call the sqrt method. + /// + public class SqrtRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sqrt + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sqrt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SqrtPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SqrtRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sqrt", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SqrtRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sqrt", rawUrl) + { + } + /// + /// Invoke action sqrt + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SqrtPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SqrtPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SqrtPi/SqrtPiPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SqrtPi/SqrtPiPostRequestBody.cs new file mode 100644 index 0000000000..178a6fe236 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SqrtPi/SqrtPiPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SqrtPi +{ + #pragma warning disable CS1591 + public class SqrtPiPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SqrtPiPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SqrtPiPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SqrtPiPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SqrtPi/SqrtPiRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SqrtPi/SqrtPiRequestBuilder.cs new file mode 100644 index 0000000000..fd787cb1ad --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SqrtPi/SqrtPiRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SqrtPi +{ + /// + /// Provides operations to call the sqrtPi method. + /// + public class SqrtPiRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sqrtPi + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sqrtPi"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SqrtPiPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SqrtPiRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sqrtPi", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SqrtPiRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sqrtPi", rawUrl) + { + } + /// + /// Invoke action sqrtPi + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SqrtPiPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SqrtPiPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevA/StDevAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevA/StDevAPostRequestBody.cs new file mode 100644 index 0000000000..33af5fb049 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevA/StDevAPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDevA +{ + #pragma warning disable CS1591 + public class StDevAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StDevAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static StDevAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new StDevAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevA/StDevARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevA/StDevARequestBuilder.cs new file mode 100644 index 0000000000..e2f4af30e4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevA/StDevARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDevA +{ + /// + /// Provides operations to call the stDevA method. + /// + public class StDevARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action stDevA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action stDevA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(StDevAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public StDevARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/stDevA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public StDevARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/stDevA", rawUrl) + { + } + /// + /// Invoke action stDevA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(StDevAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(StDevAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevPA/StDevPAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevPA/StDevPAPostRequestBody.cs new file mode 100644 index 0000000000..5e5be89090 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevPA/StDevPAPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDevPA +{ + #pragma warning disable CS1591 + public class StDevPAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StDevPAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static StDevPAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new StDevPAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevPA/StDevPARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevPA/StDevPARequestBuilder.cs new file mode 100644 index 0000000000..d801867aca --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDevPA/StDevPARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDevPA +{ + /// + /// Provides operations to call the stDevPA method. + /// + public class StDevPARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action stDevPA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action stDevPA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(StDevPAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public StDevPARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/stDevPA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public StDevPARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/stDevPA", rawUrl) + { + } + /// + /// Invoke action stDevPA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(StDevPAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(StDevPAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_P/StDev_PPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_P/StDev_PPostRequestBody.cs new file mode 100644 index 0000000000..08db86adf4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_P/StDev_PPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDev_P +{ + #pragma warning disable CS1591 + public class StDev_PPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StDev_PPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static StDev_PPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new StDev_PPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_P/StDev_PRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_P/StDev_PRequestBuilder.cs new file mode 100644 index 0000000000..8695ad5160 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_P/StDev_PRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDev_P +{ + /// + /// Provides operations to call the stDev_P method. + /// + public class StDev_PRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action stDev_P + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action stDev_P"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(StDev_PPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public StDev_PRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/stDev_P", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public StDev_PRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/stDev_P", rawUrl) + { + } + /// + /// Invoke action stDev_P + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(StDev_PPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(StDev_PPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_S/StDev_SPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_S/StDev_SPostRequestBody.cs new file mode 100644 index 0000000000..d5e84bbd62 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_S/StDev_SPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDev_S +{ + #pragma warning disable CS1591 + public class StDev_SPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StDev_SPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static StDev_SPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new StDev_SPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_S/StDev_SRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_S/StDev_SRequestBuilder.cs new file mode 100644 index 0000000000..9326859c44 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/StDev_S/StDev_SRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.StDev_S +{ + /// + /// Provides operations to call the stDev_S method. + /// + public class StDev_SRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action stDev_S + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action stDev_S"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(StDev_SPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public StDev_SRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/stDev_S", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public StDev_SRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/stDev_S", rawUrl) + { + } + /// + /// Invoke action stDev_S + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(StDev_SPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(StDev_SPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Standardize/StandardizePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Standardize/StandardizePostRequestBody.cs new file mode 100644 index 0000000000..614041a647 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Standardize/StandardizePostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Standardize +{ + #pragma warning disable CS1591 + public class StandardizePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The mean property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Mean { get; set; } +#nullable restore +#else + public Json Mean { get; set; } +#endif + /// The standardDev property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StandardDev { get; set; } +#nullable restore +#else + public Json StandardDev { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StandardizePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static StandardizePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new StandardizePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "mean", n => { Mean = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "standardDev", n => { StandardDev = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mean", Mean); + writer.WriteObjectValue("standardDev", StandardDev); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Standardize/StandardizeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Standardize/StandardizeRequestBuilder.cs new file mode 100644 index 0000000000..8db6e34a0c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Standardize/StandardizeRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Standardize +{ + /// + /// Provides operations to call the standardize method. + /// + public class StandardizeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action standardize + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action standardize"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(StandardizePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public StandardizeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/standardize", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public StandardizeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/standardize", rawUrl) + { + } + /// + /// Invoke action standardize + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(StandardizePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(StandardizePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Substitute/SubstitutePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Substitute/SubstitutePostRequestBody.cs new file mode 100644 index 0000000000..847c000ecf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Substitute/SubstitutePostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Substitute +{ + #pragma warning disable CS1591 + public class SubstitutePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The instanceNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? InstanceNum { get; set; } +#nullable restore +#else + public Json InstanceNum { get; set; } +#endif + /// The newText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NewText { get; set; } +#nullable restore +#else + public Json NewText { get; set; } +#endif + /// The oldText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? OldText { get; set; } +#nullable restore +#else + public Json OldText { get; set; } +#endif + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SubstitutePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SubstitutePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SubstitutePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "instanceNum", n => { InstanceNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "newText", n => { NewText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "oldText", n => { OldText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("instanceNum", InstanceNum); + writer.WriteObjectValue("newText", NewText); + writer.WriteObjectValue("oldText", OldText); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Substitute/SubstituteRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Substitute/SubstituteRequestBuilder.cs new file mode 100644 index 0000000000..83105b30d6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Substitute/SubstituteRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Substitute +{ + /// + /// Provides operations to call the substitute method. + /// + public class SubstituteRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action substitute + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action substitute"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SubstitutePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SubstituteRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/substitute", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SubstituteRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/substitute", rawUrl) + { + } + /// + /// Invoke action substitute + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SubstitutePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SubstitutePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Subtotal/SubtotalPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Subtotal/SubtotalPostRequestBody.cs new file mode 100644 index 0000000000..d475f5e460 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Subtotal/SubtotalPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Subtotal +{ + #pragma warning disable CS1591 + public class SubtotalPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The functionNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FunctionNum { get; set; } +#nullable restore +#else + public Json FunctionNum { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SubtotalPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SubtotalPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SubtotalPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "functionNum", n => { FunctionNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("functionNum", FunctionNum); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Subtotal/SubtotalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Subtotal/SubtotalRequestBuilder.cs new file mode 100644 index 0000000000..922426ab14 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Subtotal/SubtotalRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Subtotal +{ + /// + /// Provides operations to call the subtotal method. + /// + public class SubtotalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action subtotal + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action subtotal"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SubtotalPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SubtotalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/subtotal", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SubtotalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/subtotal", rawUrl) + { + } + /// + /// Invoke action subtotal + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SubtotalPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SubtotalPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sum/SumPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sum/SumPostRequestBody.cs new file mode 100644 index 0000000000..a8c1c3251f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sum/SumPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sum +{ + #pragma warning disable CS1591 + public class SumPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SumPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SumPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SumPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sum/SumRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sum/SumRequestBuilder.cs new file mode 100644 index 0000000000..24eac98c7f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Sum/SumRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Sum +{ + /// + /// Provides operations to call the sum method. + /// + public class SumRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sum + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sum"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SumPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SumRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sum", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SumRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sum", rawUrl) + { + } + /// + /// Invoke action sum + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SumPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SumPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIf/SumIfPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIf/SumIfPostRequestBody.cs new file mode 100644 index 0000000000..adacd42766 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIf/SumIfPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SumIf +{ + #pragma warning disable CS1591 + public class SumIfPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Criteria { get; set; } +#nullable restore +#else + public Json Criteria { get; set; } +#endif + /// The range property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Range { get; set; } +#nullable restore +#else + public Json Range { get; set; } +#endif + /// The sumRange property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SumRange { get; set; } +#nullable restore +#else + public Json SumRange { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SumIfPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SumIfPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SumIfPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "range", n => { Range = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "sumRange", n => { SumRange = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteObjectValue("range", Range); + writer.WriteObjectValue("sumRange", SumRange); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIf/SumIfRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIf/SumIfRequestBuilder.cs new file mode 100644 index 0000000000..3b5b4e73c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIf/SumIfRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SumIf +{ + /// + /// Provides operations to call the sumIf method. + /// + public class SumIfRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sumIf + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sumIf"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SumIfPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SumIfRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sumIf", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SumIfRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sumIf", rawUrl) + { + } + /// + /// Invoke action sumIf + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SumIfPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SumIfPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIfs/SumIfsPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIfs/SumIfsPostRequestBody.cs new file mode 100644 index 0000000000..544f6054e1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIfs/SumIfsPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SumIfs +{ + #pragma warning disable CS1591 + public class SumIfsPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The sumRange property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SumRange { get; set; } +#nullable restore +#else + public Json SumRange { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SumIfsPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SumIfsPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SumIfsPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "sumRange", n => { SumRange = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("sumRange", SumRange); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIfs/SumIfsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIfs/SumIfsRequestBuilder.cs new file mode 100644 index 0000000000..62bd9958a8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumIfs/SumIfsRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SumIfs +{ + /// + /// Provides operations to call the sumIfs method. + /// + public class SumIfsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sumIfs + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sumIfs"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SumIfsPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SumIfsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sumIfs", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SumIfsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sumIfs", rawUrl) + { + } + /// + /// Invoke action sumIfs + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SumIfsPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SumIfsPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumSq/SumSqPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumSq/SumSqPostRequestBody.cs new file mode 100644 index 0000000000..effd6d9640 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumSq/SumSqPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SumSq +{ + #pragma warning disable CS1591 + public class SumSqPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SumSqPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SumSqPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SumSqPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumSq/SumSqRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumSq/SumSqRequestBuilder.cs new file mode 100644 index 0000000000..26c1b47f52 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/SumSq/SumSqRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.SumSq +{ + /// + /// Provides operations to call the sumSq method. + /// + public class SumSqRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action sumSq + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action sumSq"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SumSqPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SumSqRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sumSq", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SumSqRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/sumSq", rawUrl) + { + } + /// + /// Invoke action sumSq + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SumSqPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SumSqPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Syd/SydPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Syd/SydPostRequestBody.cs new file mode 100644 index 0000000000..17a7c35bee --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Syd/SydPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Syd +{ + #pragma warning disable CS1591 + public class SydPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cost property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cost { get; set; } +#nullable restore +#else + public Json Cost { get; set; } +#endif + /// The life property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Life { get; set; } +#nullable restore +#else + public Json Life { get; set; } +#endif + /// The per property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Per { get; set; } +#nullable restore +#else + public Json Per { get; set; } +#endif + /// The salvage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Salvage { get; set; } +#nullable restore +#else + public Json Salvage { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SydPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SydPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SydPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cost", n => { Cost = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "life", n => { Life = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "per", n => { Per = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "salvage", n => { Salvage = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cost", Cost); + writer.WriteObjectValue("life", Life); + writer.WriteObjectValue("per", Per); + writer.WriteObjectValue("salvage", Salvage); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Syd/SydRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Syd/SydRequestBuilder.cs new file mode 100644 index 0000000000..b21173afb0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Syd/SydRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Syd +{ + /// + /// Provides operations to call the syd method. + /// + public class SydRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action syd + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action syd"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SydPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SydRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/syd", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SydRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/syd", rawUrl) + { + } + /// + /// Invoke action syd + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SydPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SydPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T/TPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T/TPostRequestBody.cs new file mode 100644 index 0000000000..5e53af1652 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T/TPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T +{ + #pragma warning disable CS1591 + public class TPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T/TRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T/TRequestBuilder.cs new file mode 100644 index 0000000000..350c10c4e5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T/TRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T +{ + /// + /// Provides operations to call the t method. + /// + public class TRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action t + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action t"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t", rawUrl) + { + } + /// + /// Invoke action t + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist/T_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist/T_DistPostRequestBody.cs new file mode 100644 index 0000000000..df83e7e184 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist/T_DistPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Dist +{ + #pragma warning disable CS1591 + public class T_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The degFreedom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom { get; set; } +#nullable restore +#else + public Json DegFreedom { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public T_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static T_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new T_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "degFreedom", n => { DegFreedom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("degFreedom", DegFreedom); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist/T_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist/T_DistRequestBuilder.cs new file mode 100644 index 0000000000..2bec29adfe --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist/T_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Dist +{ + /// + /// Provides operations to call the t_Dist method. + /// + public class T_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action t_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action t_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(T_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public T_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public T_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Dist", rawUrl) + { + } + /// + /// Invoke action t_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(T_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(T_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TPostRequestBody.cs new file mode 100644 index 0000000000..8efa09f9ec --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Dist_2T +{ + #pragma warning disable CS1591 + public class T_Dist_2TPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom { get; set; } +#nullable restore +#else + public Json DegFreedom { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public T_Dist_2TPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static T_Dist_2TPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new T_Dist_2TPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom", n => { DegFreedom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom", DegFreedom); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TRequestBuilder.cs new file mode 100644 index 0000000000..f510b9983a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_2T/T_Dist_2TRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Dist_2T +{ + /// + /// Provides operations to call the t_Dist_2T method. + /// + public class T_Dist_2TRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action t_Dist_2T + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action t_Dist_2T"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(T_Dist_2TPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public T_Dist_2TRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Dist_2T", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public T_Dist_2TRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Dist_2T", rawUrl) + { + } + /// + /// Invoke action t_Dist_2T + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(T_Dist_2TPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(T_Dist_2TPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTPostRequestBody.cs new file mode 100644 index 0000000000..ee72473cf5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Dist_RT +{ + #pragma warning disable CS1591 + public class T_Dist_RTPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom { get; set; } +#nullable restore +#else + public Json DegFreedom { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public T_Dist_RTPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static T_Dist_RTPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new T_Dist_RTPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom", n => { DegFreedom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom", DegFreedom); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTRequestBuilder.cs new file mode 100644 index 0000000000..46cfe74ee9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Dist_RT/T_Dist_RTRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Dist_RT +{ + /// + /// Provides operations to call the t_Dist_RT method. + /// + public class T_Dist_RTRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action t_Dist_RT + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action t_Dist_RT"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(T_Dist_RTPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public T_Dist_RTRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Dist_RT", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public T_Dist_RTRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Dist_RT", rawUrl) + { + } + /// + /// Invoke action t_Dist_RT + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(T_Dist_RTPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(T_Dist_RTPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv/T_InvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv/T_InvPostRequestBody.cs new file mode 100644 index 0000000000..fae897e2bd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv/T_InvPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Inv +{ + #pragma warning disable CS1591 + public class T_InvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom { get; set; } +#nullable restore +#else + public Json DegFreedom { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public T_InvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static T_InvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new T_InvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom", n => { DegFreedom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom", DegFreedom); + writer.WriteObjectValue("probability", Probability); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv/T_InvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv/T_InvRequestBuilder.cs new file mode 100644 index 0000000000..754320ecfd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv/T_InvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Inv +{ + /// + /// Provides operations to call the t_Inv method. + /// + public class T_InvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action t_Inv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action t_Inv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(T_InvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public T_InvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Inv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public T_InvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Inv", rawUrl) + { + } + /// + /// Invoke action t_Inv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(T_InvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(T_InvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TPostRequestBody.cs new file mode 100644 index 0000000000..1f10c1fdec --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Inv_2T +{ + #pragma warning disable CS1591 + public class T_Inv_2TPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The degFreedom property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? DegFreedom { get; set; } +#nullable restore +#else + public Json DegFreedom { get; set; } +#endif + /// The probability property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Probability { get; set; } +#nullable restore +#else + public Json Probability { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public T_Inv_2TPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static T_Inv_2TPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new T_Inv_2TPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "degFreedom", n => { DegFreedom = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "probability", n => { Probability = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("degFreedom", DegFreedom); + writer.WriteObjectValue("probability", Probability); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TRequestBuilder.cs new file mode 100644 index 0000000000..8accd67650 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/T_Inv_2T/T_Inv_2TRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.T_Inv_2T +{ + /// + /// Provides operations to call the t_Inv_2T method. + /// + public class T_Inv_2TRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action t_Inv_2T + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action t_Inv_2T"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(T_Inv_2TPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public T_Inv_2TRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Inv_2T", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public T_Inv_2TRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/t_Inv_2T", rawUrl) + { + } + /// + /// Invoke action t_Inv_2T + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(T_Inv_2TPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(T_Inv_2TPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tan/TanPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tan/TanPostRequestBody.cs new file mode 100644 index 0000000000..19389a1148 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tan/TanPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Tan +{ + #pragma warning disable CS1591 + public class TanPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TanPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TanPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TanPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tan/TanRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tan/TanRequestBuilder.cs new file mode 100644 index 0000000000..8af31efa45 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tan/TanRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Tan +{ + /// + /// Provides operations to call the tan method. + /// + public class TanRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action tan + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action tan"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TanPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TanRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tan", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TanRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tan", rawUrl) + { + } + /// + /// Invoke action tan + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TanPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TanPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tanh/TanhPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tanh/TanhPostRequestBody.cs new file mode 100644 index 0000000000..d42a28270b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tanh/TanhPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Tanh +{ + #pragma warning disable CS1591 + public class TanhPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TanhPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TanhPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TanhPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tanh/TanhRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tanh/TanhRequestBuilder.cs new file mode 100644 index 0000000000..d6a0848df1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Tanh/TanhRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Tanh +{ + /// + /// Provides operations to call the tanh method. + /// + public class TanhRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action tanh + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action tanh"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TanhPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TanhRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tanh", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TanhRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tanh", rawUrl) + { + } + /// + /// Invoke action tanh + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TanhPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TanhPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillEq/TbillEqPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillEq/TbillEqPostRequestBody.cs new file mode 100644 index 0000000000..1b073b9cb7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillEq/TbillEqPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TbillEq +{ + #pragma warning disable CS1591 + public class TbillEqPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The discount property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Discount { get; set; } +#nullable restore +#else + public Json Discount { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TbillEqPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TbillEqPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TbillEqPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "discount", n => { Discount = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("discount", Discount); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillEq/TbillEqRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillEq/TbillEqRequestBuilder.cs new file mode 100644 index 0000000000..565bea16d1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillEq/TbillEqRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TbillEq +{ + /// + /// Provides operations to call the tbillEq method. + /// + public class TbillEqRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action tbillEq + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action tbillEq"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TbillEqPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TbillEqRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tbillEq", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TbillEqRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tbillEq", rawUrl) + { + } + /// + /// Invoke action tbillEq + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TbillEqPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TbillEqPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillPrice/TbillPricePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillPrice/TbillPricePostRequestBody.cs new file mode 100644 index 0000000000..bfbac6f30b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillPrice/TbillPricePostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TbillPrice +{ + #pragma warning disable CS1591 + public class TbillPricePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The discount property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Discount { get; set; } +#nullable restore +#else + public Json Discount { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TbillPricePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TbillPricePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TbillPricePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "discount", n => { Discount = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("discount", Discount); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillPrice/TbillPriceRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillPrice/TbillPriceRequestBuilder.cs new file mode 100644 index 0000000000..e89b0d2feb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillPrice/TbillPriceRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TbillPrice +{ + /// + /// Provides operations to call the tbillPrice method. + /// + public class TbillPriceRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action tbillPrice + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action tbillPrice"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TbillPricePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TbillPriceRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tbillPrice", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TbillPriceRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tbillPrice", rawUrl) + { + } + /// + /// Invoke action tbillPrice + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TbillPricePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TbillPricePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillYield/TbillYieldPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillYield/TbillYieldPostRequestBody.cs new file mode 100644 index 0000000000..7c8d3231a9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillYield/TbillYieldPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TbillYield +{ + #pragma warning disable CS1591 + public class TbillYieldPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The pr property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pr { get; set; } +#nullable restore +#else + public Json Pr { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TbillYieldPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TbillYieldPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TbillYieldPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pr", n => { Pr = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("pr", Pr); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillYield/TbillYieldRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillYield/TbillYieldRequestBuilder.cs new file mode 100644 index 0000000000..93232ca05e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TbillYield/TbillYieldRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TbillYield +{ + /// + /// Provides operations to call the tbillYield method. + /// + public class TbillYieldRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action tbillYield + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action tbillYield"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TbillYieldPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TbillYieldRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tbillYield", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TbillYieldRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/tbillYield", rawUrl) + { + } + /// + /// Invoke action tbillYield + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TbillYieldPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TbillYieldPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Text/TextPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Text/TextPostRequestBody.cs new file mode 100644 index 0000000000..a9b84a15fb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Text/TextPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Text +{ + #pragma warning disable CS1591 + public class TextPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The formatText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? FormatText { get; set; } +#nullable restore +#else + public Json FormatText { get; set; } +#endif + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TextPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TextPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TextPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "formatText", n => { FormatText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("formatText", FormatText); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Text/TextRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Text/TextRequestBuilder.cs new file mode 100644 index 0000000000..079821346e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Text/TextRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Text +{ + /// + /// Provides operations to call the text method. + /// + public class TextRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action text + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action text"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TextPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TextRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/text", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TextRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/text", rawUrl) + { + } + /// + /// Invoke action text + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TextPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TextPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Time/TimePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Time/TimePostRequestBody.cs new file mode 100644 index 0000000000..009b40ff33 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Time/TimePostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Time +{ + #pragma warning disable CS1591 + public class TimePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The hour property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Hour { get; set; } +#nullable restore +#else + public Json Hour { get; set; } +#endif + /// The minute property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Minute { get; set; } +#nullable restore +#else + public Json Minute { get; set; } +#endif + /// The second property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Second { get; set; } +#nullable restore +#else + public Json Second { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TimePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TimePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TimePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "hour", n => { Hour = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "minute", n => { Minute = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "second", n => { Second = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("hour", Hour); + writer.WriteObjectValue("minute", Minute); + writer.WriteObjectValue("second", Second); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Time/TimeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Time/TimeRequestBuilder.cs new file mode 100644 index 0000000000..d90f70d603 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Time/TimeRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Time +{ + /// + /// Provides operations to call the time method. + /// + public class TimeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action time + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action time"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TimePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TimeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/time", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TimeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/time", rawUrl) + { + } + /// + /// Invoke action time + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TimePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TimePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Timevalue/TimevaluePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Timevalue/TimevaluePostRequestBody.cs new file mode 100644 index 0000000000..6ba9850f75 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Timevalue/TimevaluePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Timevalue +{ + #pragma warning disable CS1591 + public class TimevaluePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The timeText property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? TimeText { get; set; } +#nullable restore +#else + public Json TimeText { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TimevaluePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TimevaluePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TimevaluePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "timeText", n => { TimeText = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("timeText", TimeText); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Timevalue/TimevalueRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Timevalue/TimevalueRequestBuilder.cs new file mode 100644 index 0000000000..194e96ddca --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Timevalue/TimevalueRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Timevalue +{ + /// + /// Provides operations to call the timevalue method. + /// + public class TimevalueRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action timevalue + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action timevalue"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TimevaluePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TimevalueRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/timevalue", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TimevalueRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/timevalue", rawUrl) + { + } + /// + /// Invoke action timevalue + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TimevaluePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TimevaluePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Today/TodayRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Today/TodayRequestBuilder.cs new file mode 100644 index 0000000000..05f46c49e4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Today/TodayRequestBuilder.cs @@ -0,0 +1,102 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Today +{ + /// + /// Provides operations to call the today method. + /// + public class TodayRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action today + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action today"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TodayRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/today", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TodayRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/today", rawUrl) + { + } + /// + /// Invoke action today + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trim/TrimPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trim/TrimPostRequestBody.cs new file mode 100644 index 0000000000..f9f06a8401 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trim/TrimPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Trim +{ + #pragma warning disable CS1591 + public class TrimPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TrimPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TrimPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TrimPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trim/TrimRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trim/TrimRequestBuilder.cs new file mode 100644 index 0000000000..acab87df43 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trim/TrimRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Trim +{ + /// + /// Provides operations to call the trim method. + /// + public class TrimRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action trim + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action trim"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TrimPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TrimRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/trim", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TrimRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/trim", rawUrl) + { + } + /// + /// Invoke action trim + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TrimPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TrimPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TrimMean/TrimMeanPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TrimMean/TrimMeanPostRequestBody.cs new file mode 100644 index 0000000000..ecadcbcf0d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TrimMean/TrimMeanPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TrimMean +{ + #pragma warning disable CS1591 + public class TrimMeanPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The percent property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Percent { get; set; } +#nullable restore +#else + public Json Percent { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TrimMeanPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TrimMeanPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TrimMeanPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "percent", n => { Percent = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("percent", Percent); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TrimMean/TrimMeanRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TrimMean/TrimMeanRequestBuilder.cs new file mode 100644 index 0000000000..f25368ae28 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TrimMean/TrimMeanRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TrimMean +{ + /// + /// Provides operations to call the trimMean method. + /// + public class TrimMeanRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action trimMean + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action trimMean"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TrimMeanPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TrimMeanRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/trimMean", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TrimMeanRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/trimMean", rawUrl) + { + } + /// + /// Invoke action trimMean + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TrimMeanPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TrimMeanPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/True/TrueRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/True/TrueRequestBuilder.cs new file mode 100644 index 0000000000..8794da6f69 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/True/TrueRequestBuilder.cs @@ -0,0 +1,102 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.True +{ + /// + /// Provides operations to call the true method. + /// + public class TrueRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action true + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action true"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TrueRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/true", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TrueRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/true", rawUrl) + { + } + /// + /// Invoke action true + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trunc/TruncPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trunc/TruncPostRequestBody.cs new file mode 100644 index 0000000000..14a247794b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trunc/TruncPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Trunc +{ + #pragma warning disable CS1591 + public class TruncPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// The numDigits property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NumDigits { get; set; } +#nullable restore +#else + public Json NumDigits { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TruncPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TruncPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TruncPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "numDigits", n => { NumDigits = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteObjectValue("numDigits", NumDigits); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trunc/TruncRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trunc/TruncRequestBuilder.cs new file mode 100644 index 0000000000..00042bad56 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Trunc/TruncRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Trunc +{ + /// + /// Provides operations to call the trunc method. + /// + public class TruncRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action trunc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action trunc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TruncPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TruncRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/trunc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TruncRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/trunc", rawUrl) + { + } + /// + /// Invoke action trunc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TruncPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TruncPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TypeNamespace/TypePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TypeNamespace/TypePostRequestBody.cs new file mode 100644 index 0000000000..60db0ee36b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TypeNamespace/TypePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TypeNamespace +{ + #pragma warning disable CS1591 + public class TypePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Value { get; set; } +#nullable restore +#else + public Json Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TypePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static TypePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TypePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TypeNamespace/TypeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TypeNamespace/TypeRequestBuilder.cs new file mode 100644 index 0000000000..983958df80 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/TypeNamespace/TypeRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.TypeNamespace +{ + /// + /// Provides operations to call the type method. + /// + public class TypeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action type + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action type"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(TypePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TypeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/type", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TypeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/type", rawUrl) + { + } + /// + /// Invoke action type + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TypePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TypePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unichar/UnicharPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unichar/UnicharPostRequestBody.cs new file mode 100644 index 0000000000..ee2f78eeaa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unichar/UnicharPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Unichar +{ + #pragma warning disable CS1591 + public class UnicharPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UnicharPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static UnicharPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UnicharPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unichar/UnicharRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unichar/UnicharRequestBuilder.cs new file mode 100644 index 0000000000..41113b78c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unichar/UnicharRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Unichar +{ + /// + /// Provides operations to call the unichar method. + /// + public class UnicharRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action unichar + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action unichar"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(UnicharPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public UnicharRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/unichar", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public UnicharRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/unichar", rawUrl) + { + } + /// + /// Invoke action unichar + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UnicharPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UnicharPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unicode/UnicodePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unicode/UnicodePostRequestBody.cs new file mode 100644 index 0000000000..56a16a9a8e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unicode/UnicodePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Unicode +{ + #pragma warning disable CS1591 + public class UnicodePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UnicodePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static UnicodePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UnicodePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unicode/UnicodeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unicode/UnicodeRequestBuilder.cs new file mode 100644 index 0000000000..f010746398 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Unicode/UnicodeRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Unicode +{ + /// + /// Provides operations to call the unicode method. + /// + public class UnicodeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action unicode + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action unicode"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(UnicodePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public UnicodeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/unicode", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public UnicodeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/unicode", rawUrl) + { + } + /// + /// Invoke action unicode + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UnicodePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UnicodePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Upper/UpperPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Upper/UpperPostRequestBody.cs new file mode 100644 index 0000000000..2e4cd0919b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Upper/UpperPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Upper +{ + #pragma warning disable CS1591 + public class UpperPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpperPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static UpperPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpperPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Upper/UpperRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Upper/UpperRequestBuilder.cs new file mode 100644 index 0000000000..89bc18ffe0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Upper/UpperRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Upper +{ + /// + /// Provides operations to call the upper method. + /// + public class UpperRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action upper + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action upper"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(UpperPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public UpperRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/upper", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public UpperRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/upper", rawUrl) + { + } + /// + /// Invoke action upper + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UpperPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UpperPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Usdollar/UsdollarPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Usdollar/UsdollarPostRequestBody.cs new file mode 100644 index 0000000000..593ba75b4b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Usdollar/UsdollarPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Usdollar +{ + #pragma warning disable CS1591 + public class UsdollarPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The decimals property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Decimals { get; set; } +#nullable restore +#else + public Json Decimals { get; set; } +#endif + /// The number property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Number { get; set; } +#nullable restore +#else + public Json Number { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UsdollarPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static UsdollarPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UsdollarPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "decimals", n => { Decimals = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "number", n => { Number = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("decimals", Decimals); + writer.WriteObjectValue("number", Number); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Usdollar/UsdollarRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Usdollar/UsdollarRequestBuilder.cs new file mode 100644 index 0000000000..dfb67e7a7f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Usdollar/UsdollarRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Usdollar +{ + /// + /// Provides operations to call the usdollar method. + /// + public class UsdollarRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action usdollar + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action usdollar"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(UsdollarPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public UsdollarRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/usdollar", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public UsdollarRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/usdollar", rawUrl) + { + } + /// + /// Invoke action usdollar + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UsdollarPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UsdollarPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Value/ValuePostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Value/ValuePostRequestBody.cs new file mode 100644 index 0000000000..cc7aab42c3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Value/ValuePostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Value +{ + #pragma warning disable CS1591 + public class ValuePostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Text { get; set; } +#nullable restore +#else + public Json Text { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ValuePostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ValuePostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ValuePostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "text", n => { Text = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Value/ValueRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Value/ValueRequestBuilder.cs new file mode 100644 index 0000000000..f0120d9d92 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Value/ValueRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Value +{ + /// + /// Provides operations to call the value method. + /// + public class ValueRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action value + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action value"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ValuePostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ValueRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/value", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ValueRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/value", rawUrl) + { + } + /// + /// Invoke action value + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ValuePostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ValuePostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarA/VarAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarA/VarAPostRequestBody.cs new file mode 100644 index 0000000000..5b2c6511c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarA/VarAPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.VarA +{ + #pragma warning disable CS1591 + public class VarAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VarAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static VarAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new VarAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarA/VarARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarA/VarARequestBuilder.cs new file mode 100644 index 0000000000..439299d90b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarA/VarARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.VarA +{ + /// + /// Provides operations to call the varA method. + /// + public class VarARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action varA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action varA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(VarAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public VarARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/varA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public VarARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/varA", rawUrl) + { + } + /// + /// Invoke action varA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(VarAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(VarAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarPA/VarPAPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarPA/VarPAPostRequestBody.cs new file mode 100644 index 0000000000..fbdebbcea3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarPA/VarPAPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.VarPA +{ + #pragma warning disable CS1591 + public class VarPAPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VarPAPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static VarPAPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new VarPAPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarPA/VarPARequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarPA/VarPARequestBuilder.cs new file mode 100644 index 0000000000..98dd321a1e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/VarPA/VarPARequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.VarPA +{ + /// + /// Provides operations to call the varPA method. + /// + public class VarPARequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action varPA + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action varPA"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(VarPAPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public VarPARequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/varPA", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public VarPARequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/varPA", rawUrl) + { + } + /// + /// Invoke action varPA + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(VarPAPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(VarPAPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_P/Var_PPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_P/Var_PPostRequestBody.cs new file mode 100644 index 0000000000..c5726c17b1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_P/Var_PPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Var_P +{ + #pragma warning disable CS1591 + public class Var_PPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Var_PPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Var_PPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Var_PPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_P/Var_PRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_P/Var_PRequestBuilder.cs new file mode 100644 index 0000000000..13a879b91e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_P/Var_PRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Var_P +{ + /// + /// Provides operations to call the var_P method. + /// + public class Var_PRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action var_P + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action var_P"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Var_PPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Var_PRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/var_P", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Var_PRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/var_P", rawUrl) + { + } + /// + /// Invoke action var_P + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Var_PPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Var_PPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_S/Var_SPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_S/Var_SPostRequestBody.cs new file mode 100644 index 0000000000..681139c60b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_S/Var_SPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Var_S +{ + #pragma warning disable CS1591 + public class Var_SPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Var_SPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Var_SPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Var_SPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_S/Var_SRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_S/Var_SRequestBuilder.cs new file mode 100644 index 0000000000..b97f6b716c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Var_S/Var_SRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Var_S +{ + /// + /// Provides operations to call the var_S method. + /// + public class Var_SRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action var_S + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action var_S"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Var_SPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Var_SRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/var_S", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Var_SRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/var_S", rawUrl) + { + } + /// + /// Invoke action var_S + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Var_SPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Var_SPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vdb/VdbPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vdb/VdbPostRequestBody.cs new file mode 100644 index 0000000000..9ca31675dd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vdb/VdbPostRequestBody.cs @@ -0,0 +1,123 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Vdb +{ + #pragma warning disable CS1591 + public class VdbPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The cost property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cost { get; set; } +#nullable restore +#else + public Json Cost { get; set; } +#endif + /// The endPeriod property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndPeriod { get; set; } +#nullable restore +#else + public Json EndPeriod { get; set; } +#endif + /// The factor property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Factor { get; set; } +#nullable restore +#else + public Json Factor { get; set; } +#endif + /// The life property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Life { get; set; } +#nullable restore +#else + public Json Life { get; set; } +#endif + /// The noSwitch property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? NoSwitch { get; set; } +#nullable restore +#else + public Json NoSwitch { get; set; } +#endif + /// The salvage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Salvage { get; set; } +#nullable restore +#else + public Json Salvage { get; set; } +#endif + /// The startPeriod property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartPeriod { get; set; } +#nullable restore +#else + public Json StartPeriod { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VdbPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static VdbPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new VdbPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "cost", n => { Cost = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "endPeriod", n => { EndPeriod = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "factor", n => { Factor = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "life", n => { Life = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "noSwitch", n => { NoSwitch = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "salvage", n => { Salvage = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startPeriod", n => { StartPeriod = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("cost", Cost); + writer.WriteObjectValue("endPeriod", EndPeriod); + writer.WriteObjectValue("factor", Factor); + writer.WriteObjectValue("life", Life); + writer.WriteObjectValue("noSwitch", NoSwitch); + writer.WriteObjectValue("salvage", Salvage); + writer.WriteObjectValue("startPeriod", StartPeriod); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vdb/VdbRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vdb/VdbRequestBuilder.cs new file mode 100644 index 0000000000..0584ef2983 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vdb/VdbRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Vdb +{ + /// + /// Provides operations to call the vdb method. + /// + public class VdbRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action vdb + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action vdb"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(VdbPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public VdbRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/vdb", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public VdbRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/vdb", rawUrl) + { + } + /// + /// Invoke action vdb + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(VdbPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(VdbPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vlookup/VlookupPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vlookup/VlookupPostRequestBody.cs new file mode 100644 index 0000000000..4e7afc9fb6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vlookup/VlookupPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Vlookup +{ + #pragma warning disable CS1591 + public class VlookupPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The colIndexNum property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ColIndexNum { get; set; } +#nullable restore +#else + public Json ColIndexNum { get; set; } +#endif + /// The lookupValue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? LookupValue { get; set; } +#nullable restore +#else + public Json LookupValue { get; set; } +#endif + /// The rangeLookup property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? RangeLookup { get; set; } +#nullable restore +#else + public Json RangeLookup { get; set; } +#endif + /// The tableArray property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? TableArray { get; set; } +#nullable restore +#else + public Json TableArray { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public VlookupPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static VlookupPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new VlookupPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "colIndexNum", n => { ColIndexNum = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "lookupValue", n => { LookupValue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rangeLookup", n => { RangeLookup = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "tableArray", n => { TableArray = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("colIndexNum", ColIndexNum); + writer.WriteObjectValue("lookupValue", LookupValue); + writer.WriteObjectValue("rangeLookup", RangeLookup); + writer.WriteObjectValue("tableArray", TableArray); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vlookup/VlookupRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vlookup/VlookupRequestBuilder.cs new file mode 100644 index 0000000000..116eb51221 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Vlookup/VlookupRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Vlookup +{ + /// + /// Provides operations to call the vlookup method. + /// + public class VlookupRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action vlookup + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action vlookup"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(VlookupPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public VlookupRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/vlookup", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public VlookupRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/vlookup", rawUrl) + { + } + /// + /// Invoke action vlookup + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(VlookupPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(VlookupPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WeekNum/WeekNumPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WeekNum/WeekNumPostRequestBody.cs new file mode 100644 index 0000000000..6d6ae16a3f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WeekNum/WeekNumPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.WeekNum +{ + #pragma warning disable CS1591 + public class WeekNumPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The returnType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ReturnType { get; set; } +#nullable restore +#else + public Json ReturnType { get; set; } +#endif + /// The serialNumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SerialNumber { get; set; } +#nullable restore +#else + public Json SerialNumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WeekNumPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static WeekNumPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new WeekNumPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "returnType", n => { ReturnType = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "serialNumber", n => { SerialNumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("returnType", ReturnType); + writer.WriteObjectValue("serialNumber", SerialNumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WeekNum/WeekNumRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WeekNum/WeekNumRequestBuilder.cs new file mode 100644 index 0000000000..08db237cac --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WeekNum/WeekNumRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.WeekNum +{ + /// + /// Provides operations to call the weekNum method. + /// + public class WeekNumRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action weekNum + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action weekNum"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WeekNumPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WeekNumRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/weekNum", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WeekNumRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/weekNum", rawUrl) + { + } + /// + /// Invoke action weekNum + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WeekNumPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WeekNumPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weekday/WeekdayPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weekday/WeekdayPostRequestBody.cs new file mode 100644 index 0000000000..c04a325e6f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weekday/WeekdayPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Weekday +{ + #pragma warning disable CS1591 + public class WeekdayPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The returnType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? ReturnType { get; set; } +#nullable restore +#else + public Json ReturnType { get; set; } +#endif + /// The serialNumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SerialNumber { get; set; } +#nullable restore +#else + public Json SerialNumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WeekdayPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static WeekdayPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new WeekdayPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "returnType", n => { ReturnType = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "serialNumber", n => { SerialNumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("returnType", ReturnType); + writer.WriteObjectValue("serialNumber", SerialNumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weekday/WeekdayRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weekday/WeekdayRequestBuilder.cs new file mode 100644 index 0000000000..3b572e4998 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weekday/WeekdayRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Weekday +{ + /// + /// Provides operations to call the weekday method. + /// + public class WeekdayRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action weekday + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action weekday"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WeekdayPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WeekdayRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/weekday", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WeekdayRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/weekday", rawUrl) + { + } + /// + /// Invoke action weekday + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WeekdayPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WeekdayPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weibull_Dist/Weibull_DistPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weibull_Dist/Weibull_DistPostRequestBody.cs new file mode 100644 index 0000000000..2f6dbfe3bd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weibull_Dist/Weibull_DistPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Weibull_Dist +{ + #pragma warning disable CS1591 + public class Weibull_DistPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The alpha property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Alpha { get; set; } +#nullable restore +#else + public Json Alpha { get; set; } +#endif + /// The beta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Beta { get; set; } +#nullable restore +#else + public Json Beta { get; set; } +#endif + /// The cumulative property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Cumulative { get; set; } +#nullable restore +#else + public Json Cumulative { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Weibull_DistPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Weibull_DistPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Weibull_DistPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "alpha", n => { Alpha = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "beta", n => { Beta = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "cumulative", n => { Cumulative = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("alpha", Alpha); + writer.WriteObjectValue("beta", Beta); + writer.WriteObjectValue("cumulative", Cumulative); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weibull_Dist/Weibull_DistRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weibull_Dist/Weibull_DistRequestBuilder.cs new file mode 100644 index 0000000000..6a21c4bee9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Weibull_Dist/Weibull_DistRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Weibull_Dist +{ + /// + /// Provides operations to call the weibull_Dist method. + /// + public class Weibull_DistRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action weibull_Dist + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action weibull_Dist"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Weibull_DistPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Weibull_DistRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/weibull_Dist", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Weibull_DistRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/weibull_Dist", rawUrl) + { + } + /// + /// Invoke action weibull_Dist + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Weibull_DistPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Weibull_DistPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay/WorkDayPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay/WorkDayPostRequestBody.cs new file mode 100644 index 0000000000..059df9f992 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay/WorkDayPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.WorkDay +{ + #pragma warning disable CS1591 + public class WorkDayPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The days property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Days { get; set; } +#nullable restore +#else + public Json Days { get; set; } +#endif + /// The holidays property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Holidays { get; set; } +#nullable restore +#else + public Json Holidays { get; set; } +#endif + /// The startDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartDate { get; set; } +#nullable restore +#else + public Json StartDate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WorkDayPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static WorkDayPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new WorkDayPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "days", n => { Days = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "holidays", n => { Holidays = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startDate", n => { StartDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("days", Days); + writer.WriteObjectValue("holidays", Holidays); + writer.WriteObjectValue("startDate", StartDate); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay/WorkDayRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay/WorkDayRequestBuilder.cs new file mode 100644 index 0000000000..2860b4bc6a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay/WorkDayRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.WorkDay +{ + /// + /// Provides operations to call the workDay method. + /// + public class WorkDayRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action workDay + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action workDay"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkDayPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkDayRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/workDay", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkDayRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/workDay", rawUrl) + { + } + /// + /// Invoke action workDay + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkDayPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkDayPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlPostRequestBody.cs new file mode 100644 index 0000000000..0dc51bf902 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlPostRequestBody.cs @@ -0,0 +1,93 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.WorkDay_Intl +{ + #pragma warning disable CS1591 + public class WorkDay_IntlPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The days property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Days { get; set; } +#nullable restore +#else + public Json Days { get; set; } +#endif + /// The holidays property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Holidays { get; set; } +#nullable restore +#else + public Json Holidays { get; set; } +#endif + /// The startDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartDate { get; set; } +#nullable restore +#else + public Json StartDate { get; set; } +#endif + /// The weekend property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Weekend { get; set; } +#nullable restore +#else + public Json Weekend { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public WorkDay_IntlPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static WorkDay_IntlPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new WorkDay_IntlPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "days", n => { Days = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "holidays", n => { Holidays = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startDate", n => { StartDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "weekend", n => { Weekend = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("days", Days); + writer.WriteObjectValue("holidays", Holidays); + writer.WriteObjectValue("startDate", StartDate); + writer.WriteObjectValue("weekend", Weekend); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlRequestBuilder.cs new file mode 100644 index 0000000000..f5269300d8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/WorkDay_Intl/WorkDay_IntlRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.WorkDay_Intl +{ + /// + /// Provides operations to call the workDay_Intl method. + /// + public class WorkDay_IntlRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action workDay_Intl + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action workDay_Intl"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkDay_IntlPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkDay_IntlRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/workDay_Intl", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkDay_IntlRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/workDay_Intl", rawUrl) + { + } + /// + /// Invoke action workDay_Intl + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkDay_IntlPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkDay_IntlPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xirr/XirrPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xirr/XirrPostRequestBody.cs new file mode 100644 index 0000000000..551b09dbf2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xirr/XirrPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Xirr +{ + #pragma warning disable CS1591 + public class XirrPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The dates property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Dates { get; set; } +#nullable restore +#else + public Json Dates { get; set; } +#endif + /// The guess property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Guess { get; set; } +#nullable restore +#else + public Json Guess { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public XirrPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static XirrPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new XirrPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "dates", n => { Dates = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "guess", n => { Guess = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("dates", Dates); + writer.WriteObjectValue("guess", Guess); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xirr/XirrRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xirr/XirrRequestBuilder.cs new file mode 100644 index 0000000000..7f0d0e33a4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xirr/XirrRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Xirr +{ + /// + /// Provides operations to call the xirr method. + /// + public class XirrRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action xirr + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action xirr"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(XirrPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public XirrRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/xirr", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public XirrRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/xirr", rawUrl) + { + } + /// + /// Invoke action xirr + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(XirrPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(XirrPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xnpv/XnpvPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xnpv/XnpvPostRequestBody.cs new file mode 100644 index 0000000000..c87b020c5a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xnpv/XnpvPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Xnpv +{ + #pragma warning disable CS1591 + public class XnpvPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The dates property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Dates { get; set; } +#nullable restore +#else + public Json Dates { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public XnpvPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static XnpvPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new XnpvPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "dates", n => { Dates = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("dates", Dates); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xnpv/XnpvRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xnpv/XnpvRequestBuilder.cs new file mode 100644 index 0000000000..b41d0873ad --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xnpv/XnpvRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Xnpv +{ + /// + /// Provides operations to call the xnpv method. + /// + public class XnpvRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action xnpv + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action xnpv"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(XnpvPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public XnpvRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/xnpv", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public XnpvRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/xnpv", rawUrl) + { + } + /// + /// Invoke action xnpv + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(XnpvPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(XnpvPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xor/XorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xor/XorPostRequestBody.cs new file mode 100644 index 0000000000..22cb40f9b8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xor/XorPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Xor +{ + #pragma warning disable CS1591 + public class XorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public XorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static XorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new XorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xor/XorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xor/XorRequestBuilder.cs new file mode 100644 index 0000000000..7ef926babc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Xor/XorRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Xor +{ + /// + /// Provides operations to call the xor method. + /// + public class XorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action xor + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action xor"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(XorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public XorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/xor", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public XorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/xor", rawUrl) + { + } + /// + /// Invoke action xor + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(XorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(XorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Year/YearPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Year/YearPostRequestBody.cs new file mode 100644 index 0000000000..a487a2957f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Year/YearPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Year +{ + #pragma warning disable CS1591 + public class YearPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The serialNumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SerialNumber { get; set; } +#nullable restore +#else + public Json SerialNumber { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public YearPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static YearPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new YearPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "serialNumber", n => { SerialNumber = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("serialNumber", SerialNumber); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Year/YearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Year/YearRequestBuilder.cs new file mode 100644 index 0000000000..1a1ecebd36 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Year/YearRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Year +{ + /// + /// Provides operations to call the year method. + /// + public class YearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action year + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action year"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(YearPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public YearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/year", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public YearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/year", rawUrl) + { + } + /// + /// Invoke action year + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(YearPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(YearPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YearFrac/YearFracPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YearFrac/YearFracPostRequestBody.cs new file mode 100644 index 0000000000..754f0f52bf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YearFrac/YearFracPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.YearFrac +{ + #pragma warning disable CS1591 + public class YearFracPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The endDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndDate { get; set; } +#nullable restore +#else + public Json EndDate { get; set; } +#endif + /// The startDate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartDate { get; set; } +#nullable restore +#else + public Json StartDate { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public YearFracPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static YearFracPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new YearFracPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "endDate", n => { EndDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startDate", n => { StartDate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("endDate", EndDate); + writer.WriteObjectValue("startDate", StartDate); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YearFrac/YearFracRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YearFrac/YearFracRequestBuilder.cs new file mode 100644 index 0000000000..47a5299f48 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YearFrac/YearFracRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.YearFrac +{ + /// + /// Provides operations to call the yearFrac method. + /// + public class YearFracRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action yearFrac + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action yearFrac"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(YearFracPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public YearFracRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/yearFrac", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public YearFracRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/yearFrac", rawUrl) + { + } + /// + /// Invoke action yearFrac + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(YearFracPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(YearFracPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Yield/YieldPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Yield/YieldPostRequestBody.cs new file mode 100644 index 0000000000..7c803cf017 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Yield/YieldPostRequestBody.cs @@ -0,0 +1,123 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Yield +{ + #pragma warning disable CS1591 + public class YieldPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The frequency property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Frequency { get; set; } +#nullable restore +#else + public Json Frequency { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The pr property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pr { get; set; } +#nullable restore +#else + public Json Pr { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public YieldPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static YieldPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new YieldPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "frequency", n => { Frequency = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pr", n => { Pr = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("frequency", Frequency); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("pr", Pr); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Yield/YieldRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Yield/YieldRequestBuilder.cs new file mode 100644 index 0000000000..db75e0a67c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Yield/YieldRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Yield +{ + /// + /// Provides operations to call the yield method. + /// + public class YieldRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action yield + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action yield"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(YieldPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public YieldRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/yield", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public YieldRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/yield", rawUrl) + { + } + /// + /// Invoke action yield + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(YieldPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(YieldPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldDisc/YieldDiscPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldDisc/YieldDiscPostRequestBody.cs new file mode 100644 index 0000000000..d74aa82405 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldDisc/YieldDiscPostRequestBody.cs @@ -0,0 +1,103 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.YieldDisc +{ + #pragma warning disable CS1591 + public class YieldDiscPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The pr property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pr { get; set; } +#nullable restore +#else + public Json Pr { get; set; } +#endif + /// The redemption property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Redemption { get; set; } +#nullable restore +#else + public Json Redemption { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public YieldDiscPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static YieldDiscPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new YieldDiscPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pr", n => { Pr = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "redemption", n => { Redemption = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("pr", Pr); + writer.WriteObjectValue("redemption", Redemption); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldDisc/YieldDiscRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldDisc/YieldDiscRequestBuilder.cs new file mode 100644 index 0000000000..61400f16d4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldDisc/YieldDiscRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.YieldDisc +{ + /// + /// Provides operations to call the yieldDisc method. + /// + public class YieldDiscRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action yieldDisc + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action yieldDisc"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(YieldDiscPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public YieldDiscRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/yieldDisc", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public YieldDiscRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/yieldDisc", rawUrl) + { + } + /// + /// Invoke action yieldDisc + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(YieldDiscPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(YieldDiscPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldMat/YieldMatPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldMat/YieldMatPostRequestBody.cs new file mode 100644 index 0000000000..21bfce26bb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldMat/YieldMatPostRequestBody.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.YieldMat +{ + #pragma warning disable CS1591 + public class YieldMatPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The basis property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Basis { get; set; } +#nullable restore +#else + public Json Basis { get; set; } +#endif + /// The issue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Issue { get; set; } +#nullable restore +#else + public Json Issue { get; set; } +#endif + /// The maturity property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Maturity { get; set; } +#nullable restore +#else + public Json Maturity { get; set; } +#endif + /// The pr property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Pr { get; set; } +#nullable restore +#else + public Json Pr { get; set; } +#endif + /// The rate property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Rate { get; set; } +#nullable restore +#else + public Json Rate { get; set; } +#endif + /// The settlement property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Settlement { get; set; } +#nullable restore +#else + public Json Settlement { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public YieldMatPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static YieldMatPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new YieldMatPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "basis", n => { Basis = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "issue", n => { Issue = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "maturity", n => { Maturity = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "pr", n => { Pr = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "rate", n => { Rate = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "settlement", n => { Settlement = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("basis", Basis); + writer.WriteObjectValue("issue", Issue); + writer.WriteObjectValue("maturity", Maturity); + writer.WriteObjectValue("pr", Pr); + writer.WriteObjectValue("rate", Rate); + writer.WriteObjectValue("settlement", Settlement); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldMat/YieldMatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldMat/YieldMatRequestBuilder.cs new file mode 100644 index 0000000000..916375bef8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/YieldMat/YieldMatRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.YieldMat +{ + /// + /// Provides operations to call the yieldMat method. + /// + public class YieldMatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action yieldMat + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action yieldMat"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(YieldMatPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public YieldMatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/yieldMat", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public YieldMatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/yieldMat", rawUrl) + { + } + /// + /// Invoke action yieldMat + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(YieldMatPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(YieldMatPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Z_Test/Z_TestPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Z_Test/Z_TestPostRequestBody.cs new file mode 100644 index 0000000000..4864c97d88 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Z_Test/Z_TestPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Z_Test +{ + #pragma warning disable CS1591 + public class Z_TestPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The array property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Array { get; set; } +#nullable restore +#else + public Json Array { get; set; } +#endif + /// The sigma property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Sigma { get; set; } +#nullable restore +#else + public Json Sigma { get; set; } +#endif + /// The x property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? X { get; set; } +#nullable restore +#else + public Json X { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Z_TestPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static Z_TestPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new Z_TestPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "array", n => { Array = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "sigma", n => { Sigma = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "x", n => { X = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("array", Array); + writer.WriteObjectValue("sigma", Sigma); + writer.WriteObjectValue("x", X); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Z_Test/Z_TestRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Z_Test/Z_TestRequestBuilder.cs new file mode 100644 index 0000000000..63fa70c681 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Functions/Z_Test/Z_TestRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions.Z_Test +{ + /// + /// Provides operations to call the z_Test method. + /// + public class Z_TestRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action z_Test + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action z_Test"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Z_TestPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public Z_TestRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/z_Test", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public Z_TestRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/functions/z_Test", rawUrl) + { + } + /// + /// Invoke action z_Test + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Z_TestPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Z_TestPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..a620911218 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Add/AddPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The comment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Comment { get; set; } +#nullable restore +#else + public string Comment { get; set; } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The reference property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Reference { get; set; } +#nullable restore +#else + public Json Reference { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "comment", n => { Comment = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "reference", n => { Reference = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("comment", Comment); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("reference", Reference); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..42c0398c75 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Add/AddRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Adds a new name to the collection of the given scope using the user's locale for the formula. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Adds a new name to the collection of the given scope using the user's locale for the formula.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/nameditem-add?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/add", rawUrl) + { + } + /// + /// Adds a new name to the collection of the given scope using the user's locale for the formula. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalPostRequestBody.cs new file mode 100644 index 0000000000..917197c11e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalPostRequestBody.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.AddFormulaLocal +{ + #pragma warning disable CS1591 + public class AddFormulaLocalPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The comment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Comment { get; set; } +#nullable restore +#else + public string Comment { get; set; } +#endif + /// The formula property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Formula { get; set; } +#nullable restore +#else + public string Formula { get; set; } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddFormulaLocalPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddFormulaLocalPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddFormulaLocalPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "comment", n => { Comment = n.GetStringValue(); } }, + { "formula", n => { Formula = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("comment", Comment); + writer.WriteStringValue("formula", Formula); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs new file mode 100644 index 0000000000..65b4e32304 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.AddFormulaLocal +{ + /// + /// Provides operations to call the addFormulaLocal method. + /// + public class AddFormulaLocalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Adds a new name to the collection of the given scope using the user's locale for the formula. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Adds a new name to the collection of the given scope using the user's locale for the formula.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/nameditem-addformulalocal?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddFormulaLocalPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddFormulaLocalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/addFormulaLocal", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddFormulaLocalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/addFormulaLocal", rawUrl) + { + } + /// + /// Adds a new name to the collection of the given scope using the user's locale for the formula. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddFormulaLocalPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddFormulaLocalPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..9432834555 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Item/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..69e8636d54 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Item/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Item.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/nameditem-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/{workbookNamedItem%2Did}/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/{workbookNamedItem%2Did}/range()", rawUrl) + { + } + /// + /// Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Item/WorkbookNamedItemItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Item/WorkbookNamedItemItemRequestBuilder.cs new file mode 100644 index 0000000000..223e4207fb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Item/WorkbookNamedItemItemRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Item.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Item.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Item +{ + /// + /// Provides operations to manage the names property of the microsoft.graph.workbook entity. + /// + public class WorkbookNamedItemItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property names for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property names for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents a collection of workbooks scoped named items (named ranges and constants). Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of workbooks scoped named items (named ranges and constants). Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property names in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property names in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookNamedItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookNamedItem entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookNamedItem entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookNamedItemItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/{workbookNamedItem%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookNamedItemItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/{workbookNamedItem%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property names for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of workbooks scoped named items (named ranges and constants). Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property names in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookNamedItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookNamedItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of workbooks scoped named items (named ranges and constants). Read-only. + /// + public class WorkbookNamedItemItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Item/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..725cea7a54 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/Item/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,148 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Item.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookNamedItem entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/{workbookNamedItem%2Did}/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names/{workbookNamedItem%2Did}/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/NamesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/NamesRequestBuilder.cs new file mode 100644 index 0000000000..9d721f65dc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Names/NamesRequestBuilder.cs @@ -0,0 +1,380 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.AddFormulaLocal; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names +{ + /// + /// Provides operations to manage the names property of the microsoft.graph.workbook entity. + /// + public class NamesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the addFormulaLocal method. + /// + /// A + public Command BuildAddFormulaLocalNavCommand() + { + var command = new Command("add-formula-local"); + command.Description = "Provides operations to call the addFormulaLocal method."; + var builder = new AddFormulaLocalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the names property of the microsoft.graph.workbook entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookNamedItemItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRangeNavCommand()); + commands.Add(builder.BuildWorksheetNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to names for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to names for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookNamedItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Represents a collection of workbooks scoped named items (named ranges and constants). Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents a collection of workbooks scoped named items (named ranges and constants). Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NamesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NamesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/names{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of workbooks scoped named items (named ranges and constants). Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to names for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookNamedItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookNamedItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of workbooks scoped named items (named ranges and constants). Read-only. + /// + public class NamesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Operations/Item/WorkbookOperationItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Operations/Item/WorkbookOperationItemRequestBuilder.cs new file mode 100644 index 0000000000..a1d59ccb22 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Operations/Item/WorkbookOperationItemRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Operations.Item +{ + /// + /// Provides operations to manage the operations property of the microsoft.graph.workbook entity. + /// + public class WorkbookOperationItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property operations for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property operations for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookOperationIdOption = new Option("--workbook-operation-id", description: "The unique identifier of workbookOperation") { + }; + workbookOperationIdOption.IsRequired = true; + command.AddOption(workbookOperationIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookOperationId = invocationContext.ParseResult.GetValueForOption(workbookOperationIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookOperationId is not null) requestInfo.PathParameters.Add("workbookOperation%2Did", workbookOperationId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookOperationIdOption = new Option("--workbook-operation-id", description: "The unique identifier of workbookOperation") { + }; + workbookOperationIdOption.IsRequired = true; + command.AddOption(workbookOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookOperationId = invocationContext.ParseResult.GetValueForOption(workbookOperationIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookOperationId is not null) requestInfo.PathParameters.Add("workbookOperation%2Did", workbookOperationId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property operations in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property operations in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookOperationIdOption = new Option("--workbook-operation-id", description: "The unique identifier of workbookOperation") { + }; + workbookOperationIdOption.IsRequired = true; + command.AddOption(workbookOperationIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookOperationId = invocationContext.ParseResult.GetValueForOption(workbookOperationIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookOperation.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookOperationId is not null) requestInfo.PathParameters.Add("workbookOperation%2Did", workbookOperationId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookOperationItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/operations/{workbookOperation%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookOperationItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/operations/{workbookOperation%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property operations for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property operations in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookOperation body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookOperation body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// + public class WorkbookOperationItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Operations/OperationsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Operations/OperationsRequestBuilder.cs new file mode 100644 index 0000000000..c2a4769ac3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Operations/OperationsRequestBuilder.cs @@ -0,0 +1,280 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Operations.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Operations +{ + /// + /// Provides operations to manage the operations property of the microsoft.graph.workbook entity. + /// + public class OperationsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the operations property of the microsoft.graph.workbook entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var builder = new WorkbookOperationItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, new(0)); + } + /// + /// Create new navigation property to operations for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to operations for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookOperation.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OperationsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/operations{?%24expand,%24orderby,%24search,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OperationsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/operations{?%24expand,%24orderby,%24search,%24select}", rawUrl) + { + } + /// + /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to operations for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookOperation body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookOperation body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The status of workbook operations. Getting an operation collection is not supported, but you can get the status of a long-running operation if the Location header is returned in the response. Read-only. + /// + public class OperationsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/RefreshSession/RefreshSessionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/RefreshSession/RefreshSessionRequestBuilder.cs new file mode 100644 index 0000000000..1aebdd6b2d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/RefreshSession/RefreshSessionRequestBuilder.cs @@ -0,0 +1,92 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.RefreshSession +{ + /// + /// Provides operations to call the refreshSession method. + /// + public class RefreshSessionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Use this API to refresh an existing workbook session. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Use this API to refresh an existing workbook session.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/workbook-refreshsession?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RefreshSessionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/refreshSession", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RefreshSessionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/refreshSession", rawUrl) + { + } + /// + /// Use this API to refresh an existing workbook session. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/SessionInfoResourceWithKey/SessionInfoResourceWithKeyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/SessionInfoResourceWithKey/SessionInfoResourceWithKeyRequestBuilder.cs new file mode 100644 index 0000000000..c8ffdd1013 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/SessionInfoResourceWithKey/SessionInfoResourceWithKeyRequestBuilder.cs @@ -0,0 +1,108 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.SessionInfoResourceWithKey +{ + /// + /// Provides operations to call the sessionInfoResource method. + /// + public class SessionInfoResourceWithKeyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function sessionInfoResource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function sessionInfoResource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var keyOption = new Option("--key", description: "Usage: key='{key}'") { + }; + keyOption.IsRequired = true; + command.AddOption(keyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var key = invocationContext.ParseResult.GetValueForOption(keyOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (key is not null) requestInfo.PathParameters.Add("key", key); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SessionInfoResourceWithKeyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/sessionInfoResource(key='{key}')", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SessionInfoResourceWithKeyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/sessionInfoResource(key='{key}')", rawUrl) + { + } + /// + /// Invoke function sessionInfoResource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/TableRowOperationResultWithKey/TableRowOperationResultWithKeyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/TableRowOperationResultWithKey/TableRowOperationResultWithKeyRequestBuilder.cs new file mode 100644 index 0000000000..e6f787c76f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/TableRowOperationResultWithKey/TableRowOperationResultWithKeyRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.TableRowOperationResultWithKey +{ + /// + /// Provides operations to call the tableRowOperationResult method. + /// + public class TableRowOperationResultWithKeyRequestBuilder : BaseCliRequestBuilder + { + /// + /// This function is the last in a series of steps to create a workbookTableRow resource asynchronously. A best practice to create multiple table rows is to batch them in one create tableRow operation and carry out the operation asynchronously. An asynchronous request to create table rows involves the following steps:1. Issue an async Create tableRow request and get the query URL returned in the Location response header.2. Use the query URL returned from step 1 to issue the Get workbookOperation request and get the operation ID for step 3. Alternatively, for convenience, after you get a succeeded operationStatus result, you can get the query URL from the resourceLocation property of the workbookOperation returned in the response, and apply the query URL to step 3. 3. Use the query URL returned from step 2 as the GET request URL for this function tableRowOperationResult. A successful function call returns the new table rows in a workbookTableRow resource. This function does not do anything if called independently. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "This function is the last in a series of steps to create a workbookTableRow resource asynchronously. A best practice to create multiple table rows is to batch them in one create tableRow operation and carry out the operation asynchronously. An asynchronous request to create table rows involves the following steps:1. Issue an async Create tableRow request and get the query URL returned in the Location response header.2. Use the query URL returned from step 1 to issue the Get workbookOperation request and get the operation ID for step 3. Alternatively, for convenience, after you get a succeeded operationStatus result, you can get the query URL from the resourceLocation property of the workbookOperation returned in the response, and apply the query URL to step 3. 3. Use the query URL returned from step 2 as the GET request URL for this function tableRowOperationResult. A successful function call returns the new table rows in a workbookTableRow resource. This function does not do anything if called independently.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/workbook-tablerowoperationresult?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var keyOption = new Option("--key", description: "Usage: key='{key}'") { + }; + keyOption.IsRequired = true; + command.AddOption(keyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var key = invocationContext.ParseResult.GetValueForOption(keyOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (key is not null) requestInfo.PathParameters.Add("key", key); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TableRowOperationResultWithKeyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tableRowOperationResult(key='{key}')", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TableRowOperationResultWithKeyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tableRowOperationResult(key='{key}')", rawUrl) + { + } + /// + /// This function is the last in a series of steps to create a workbookTableRow resource asynchronously. A best practice to create multiple table rows is to batch them in one create tableRow operation and carry out the operation asynchronously. An asynchronous request to create table rows involves the following steps:1. Issue an async Create tableRow request and get the query URL returned in the Location response header.2. Use the query URL returned from step 1 to issue the Get workbookOperation request and get the operation ID for step 3. Alternatively, for convenience, after you get a succeeded operationStatus result, you can get the query URL from the resourceLocation property of the workbookOperation returned in the response, and apply the query URL to step 3. 3. Use the query URL returned from step 2 as the GET request URL for this function tableRowOperationResult. A successful function call returns the new table rows in a workbookTableRow resource. This function does not do anything if called independently. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..0064433dcc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Add/AddPostRequestBody.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The address property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Address { get; set; } +#nullable restore +#else + public string Address { get; set; } +#endif + /// The hasHeaders property + public bool? HasHeaders { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "address", n => { Address = n.GetStringValue(); } }, + { "hasHeaders", n => { HasHeaders = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("address", Address); + writer.WriteBoolValue("hasHeaders", HasHeaders); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..18d34b24fa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Add/AddRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Use this API to create a new Table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Use this API to create a new Table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/workbook-post-tables?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/add", rawUrl) + { + } + /// + /// Use this API to create a new Table. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Count/CountGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Count/CountGetResponse.cs new file mode 100644 index 0000000000..8226f1a19b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Count/CountGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Count +{ + #pragma warning disable CS1591 + public class CountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public int? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..b0fa99cf65 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Count/CountRequestBuilder.cs @@ -0,0 +1,101 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function count + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/count()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/count()", rawUrl) + { + } + /// + /// Invoke function count + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs new file mode 100644 index 0000000000..02617ef25d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.ClearFilters +{ + /// + /// Provides operations to call the clearFilters method. + /// + public class ClearFiltersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clears all the filters currently applied on the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clears all the filters currently applied on the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-clearfilters?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearFiltersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/clearFilters", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearFiltersRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/clearFilters", rawUrl) + { + } + /// + /// Clears all the filters currently applied on the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..39f763d73d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Add/AddPostRequestBody.cs @@ -0,0 +1,77 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The index property + public int? Index { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "index", n => { Index = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("index", Index); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..1752654717 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Add/AddRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Adds a new column to the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Adds a new column to the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumncollection-add?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/add", rawUrl) + { + } + /// + /// Adds a new column to the table. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ColumnsRequestBuilder.cs new file mode 100644 index 0000000000..124d005117 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ColumnsRequestBuilder.cs @@ -0,0 +1,405 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + public class ColumnsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookTableColumnItemRequestBuilder(PathParameters); + commands.Add(builder.BuildDataBodyRangeNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildFilterNavCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildHeaderRowRangeNavCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRangeNavCommand()); + commands.Add(builder.BuildTotalRowRangeNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableColumn.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the itemAt method. + /// + /// A + public Command BuildItemAtWithIndexRbCommand() + { + var command = new Command("item-at-with-index"); + command.Description = "Provides operations to call the itemAt method."; + var builder = new ItemAtWithIndexRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildDataBodyRangeNavCommand()); + nonExecCommands.Add(builder.BuildFilterNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildHeaderRowRangeNavCommand()); + nonExecCommands.Add(builder.BuildRangeNavCommand()); + nonExecCommands.Add(builder.BuildTotalRowRangeNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents a collection of all the columns in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTableColumn body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTableColumn body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + public class ColumnsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Count/CountGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Count/CountGetResponse.cs new file mode 100644 index 0000000000..26d7f72ed3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Count/CountGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Count +{ + #pragma warning disable CS1591 + public class CountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public int? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..535378b2f5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Count/CountRequestBuilder.cs @@ -0,0 +1,107 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function count + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/count()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/count()", rawUrl) + { + } + /// + /// Invoke function count + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs new file mode 100644 index 0000000000..b8325245e9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.DataBodyRange +{ + /// + /// Provides operations to call the dataBodyRange method. + /// + public class DataBodyRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the data body of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the data body of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-databodyrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataBodyRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/dataBodyRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataBodyRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/dataBodyRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the data body of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyPostRequestBody.cs new file mode 100644 index 0000000000..447bc338bd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.Apply +{ + #pragma warning disable CS1591 + public class ApplyPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public WorkbookFilterCriteria? Criteria { get; set; } +#nullable restore +#else + public WorkbookFilterCriteria Criteria { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(WorkbookFilterCriteria.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs new file mode 100644 index 0000000000..fd61158a30 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.Apply +{ + /// + /// Provides operations to call the apply method. + /// + public class ApplyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Apply the given filter criteria on the given column. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Apply the given filter criteria on the given column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/filter-apply?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/apply", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/apply", rawUrl) + { + } + /// + /// Apply the given filter criteria on the given column. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterPostRequestBody.cs new file mode 100644 index 0000000000..f4b543dd5d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterPostRequestBody.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyBottomItemsFilter +{ + #pragma warning disable CS1591 + public class ApplyBottomItemsFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The count property + public int? Count { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ApplyBottomItemsFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyBottomItemsFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyBottomItemsFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "count", n => { Count = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("count", Count); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs new file mode 100644 index 0000000000..1177d7c4be --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyBottomItemsFilter +{ + /// + /// Provides operations to call the applyBottomItemsFilter method. + /// + public class ApplyBottomItemsFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyBottomItemsFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyBottomItemsFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyBottomItemsFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyBottomItemsFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyBottomItemsFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyBottomItemsFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyBottomItemsFilter", rawUrl) + { + } + /// + /// Invoke action applyBottomItemsFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyBottomItemsFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyBottomItemsFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterPostRequestBody.cs new file mode 100644 index 0000000000..ddd8576c88 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterPostRequestBody.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyBottomPercentFilter +{ + #pragma warning disable CS1591 + public class ApplyBottomPercentFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The percent property + public int? Percent { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ApplyBottomPercentFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyBottomPercentFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyBottomPercentFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "percent", n => { Percent = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("percent", Percent); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs new file mode 100644 index 0000000000..e39058a2c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyBottomPercentFilter +{ + /// + /// Provides operations to call the applyBottomPercentFilter method. + /// + public class ApplyBottomPercentFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyBottomPercentFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyBottomPercentFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyBottomPercentFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyBottomPercentFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyBottomPercentFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyBottomPercentFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyBottomPercentFilter", rawUrl) + { + } + /// + /// Invoke action applyBottomPercentFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyBottomPercentFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyBottomPercentFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterPostRequestBody.cs new file mode 100644 index 0000000000..88be4e07bb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyCellColorFilter +{ + #pragma warning disable CS1591 + public class ApplyCellColorFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyCellColorFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyCellColorFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyCellColorFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs new file mode 100644 index 0000000000..ce12e232e0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyCellColorFilter +{ + /// + /// Provides operations to call the applyCellColorFilter method. + /// + public class ApplyCellColorFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyCellColorFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyCellColorFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyCellColorFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyCellColorFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyCellColorFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyCellColorFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyCellColorFilter", rawUrl) + { + } + /// + /// Invoke action applyCellColorFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyCellColorFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyCellColorFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterPostRequestBody.cs new file mode 100644 index 0000000000..b55f493f8e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterPostRequestBody.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyCustomFilter +{ + #pragma warning disable CS1591 + public class ApplyCustomFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Criteria1 { get; set; } +#nullable restore +#else + public string Criteria1 { get; set; } +#endif + /// The criteria2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Criteria2 { get; set; } +#nullable restore +#else + public string Criteria2 { get; set; } +#endif + /// The oper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Oper { get; set; } +#nullable restore +#else + public string Oper { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyCustomFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyCustomFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyCustomFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria1", n => { Criteria1 = n.GetStringValue(); } }, + { "criteria2", n => { Criteria2 = n.GetStringValue(); } }, + { "oper", n => { Oper = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("criteria1", Criteria1); + writer.WriteStringValue("criteria2", Criteria2); + writer.WriteStringValue("oper", Oper); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs new file mode 100644 index 0000000000..c70c9793fd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyCustomFilter +{ + /// + /// Provides operations to call the applyCustomFilter method. + /// + public class ApplyCustomFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyCustomFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyCustomFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyCustomFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyCustomFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyCustomFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyCustomFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyCustomFilter", rawUrl) + { + } + /// + /// Invoke action applyCustomFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyCustomFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyCustomFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterPostRequestBody.cs new file mode 100644 index 0000000000..a724851268 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyDynamicFilter +{ + #pragma warning disable CS1591 + public class ApplyDynamicFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Criteria { get; set; } +#nullable restore +#else + public string Criteria { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyDynamicFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyDynamicFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyDynamicFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("criteria", Criteria); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs new file mode 100644 index 0000000000..bc00742bd1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyDynamicFilter +{ + /// + /// Provides operations to call the applyDynamicFilter method. + /// + public class ApplyDynamicFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyDynamicFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyDynamicFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyDynamicFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyDynamicFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyDynamicFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyDynamicFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyDynamicFilter", rawUrl) + { + } + /// + /// Invoke action applyDynamicFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyDynamicFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyDynamicFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterPostRequestBody.cs new file mode 100644 index 0000000000..e179898455 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyFontColorFilter +{ + #pragma warning disable CS1591 + public class ApplyFontColorFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyFontColorFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyFontColorFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyFontColorFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs new file mode 100644 index 0000000000..901d770aa9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyFontColorFilter +{ + /// + /// Provides operations to call the applyFontColorFilter method. + /// + public class ApplyFontColorFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyFontColorFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyFontColorFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyFontColorFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyFontColorFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyFontColorFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyFontColorFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyFontColorFilter", rawUrl) + { + } + /// + /// Invoke action applyFontColorFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyFontColorFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyFontColorFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterPostRequestBody.cs new file mode 100644 index 0000000000..03ab606994 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyIconFilter +{ + #pragma warning disable CS1591 + public class ApplyIconFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The icon property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public WorkbookIcon? Icon { get; set; } +#nullable restore +#else + public WorkbookIcon Icon { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyIconFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyIconFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyIconFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "icon", n => { Icon = n.GetObjectValue(WorkbookIcon.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("icon", Icon); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs new file mode 100644 index 0000000000..4d88c94bd6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyIconFilter +{ + /// + /// Provides operations to call the applyIconFilter method. + /// + public class ApplyIconFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyIconFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyIconFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyIconFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyIconFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyIconFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyIconFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyIconFilter", rawUrl) + { + } + /// + /// Invoke action applyIconFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyIconFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyIconFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterPostRequestBody.cs new file mode 100644 index 0000000000..56088e527c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterPostRequestBody.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyTopItemsFilter +{ + #pragma warning disable CS1591 + public class ApplyTopItemsFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The count property + public int? Count { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ApplyTopItemsFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyTopItemsFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyTopItemsFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "count", n => { Count = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("count", Count); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs new file mode 100644 index 0000000000..a3e5600bc9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyTopItemsFilter +{ + /// + /// Provides operations to call the applyTopItemsFilter method. + /// + public class ApplyTopItemsFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyTopItemsFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyTopItemsFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyTopItemsFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyTopItemsFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyTopItemsFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyTopItemsFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyTopItemsFilter", rawUrl) + { + } + /// + /// Invoke action applyTopItemsFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyTopItemsFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyTopItemsFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterPostRequestBody.cs new file mode 100644 index 0000000000..d286a8e614 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterPostRequestBody.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyTopPercentFilter +{ + #pragma warning disable CS1591 + public class ApplyTopPercentFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The percent property + public int? Percent { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ApplyTopPercentFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyTopPercentFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyTopPercentFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "percent", n => { Percent = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("percent", Percent); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs new file mode 100644 index 0000000000..5d605d7a7e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyTopPercentFilter +{ + /// + /// Provides operations to call the applyTopPercentFilter method. + /// + public class ApplyTopPercentFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyTopPercentFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyTopPercentFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyTopPercentFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyTopPercentFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyTopPercentFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyTopPercentFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyTopPercentFilter", rawUrl) + { + } + /// + /// Invoke action applyTopPercentFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyTopPercentFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyTopPercentFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterPostRequestBody.cs new file mode 100644 index 0000000000..51578d017e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyValuesFilter +{ + #pragma warning disable CS1591 + public class ApplyValuesFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyValuesFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyValuesFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyValuesFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs new file mode 100644 index 0000000000..c8b1bf7cfd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyValuesFilter +{ + /// + /// Provides operations to call the applyValuesFilter method. + /// + public class ApplyValuesFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyValuesFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyValuesFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyValuesFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyValuesFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyValuesFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyValuesFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyValuesFilter", rawUrl) + { + } + /// + /// Invoke action applyValuesFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyValuesFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyValuesFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..ea480ce550 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the filter on the given column. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the filter on the given column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/filter-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/clear", rawUrl) + { + } + /// + /// Clear the filter on the given column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs new file mode 100644 index 0000000000..f4c7707c11 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs @@ -0,0 +1,532 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.Apply; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyBottomItemsFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyBottomPercentFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyCellColorFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyCustomFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyDynamicFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyFontColorFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyIconFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyTopItemsFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyTopPercentFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.ApplyValuesFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter +{ + /// + /// Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity. + /// + public class FilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the applyBottomItemsFilter method. + /// + /// A + public Command BuildApplyBottomItemsFilterNavCommand() + { + var command = new Command("apply-bottom-items-filter"); + command.Description = "Provides operations to call the applyBottomItemsFilter method."; + var builder = new ApplyBottomItemsFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyBottomPercentFilter method. + /// + /// A + public Command BuildApplyBottomPercentFilterNavCommand() + { + var command = new Command("apply-bottom-percent-filter"); + command.Description = "Provides operations to call the applyBottomPercentFilter method."; + var builder = new ApplyBottomPercentFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyCellColorFilter method. + /// + /// A + public Command BuildApplyCellColorFilterNavCommand() + { + var command = new Command("apply-cell-color-filter"); + command.Description = "Provides operations to call the applyCellColorFilter method."; + var builder = new ApplyCellColorFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyCustomFilter method. + /// + /// A + public Command BuildApplyCustomFilterNavCommand() + { + var command = new Command("apply-custom-filter"); + command.Description = "Provides operations to call the applyCustomFilter method."; + var builder = new ApplyCustomFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyDynamicFilter method. + /// + /// A + public Command BuildApplyDynamicFilterNavCommand() + { + var command = new Command("apply-dynamic-filter"); + command.Description = "Provides operations to call the applyDynamicFilter method."; + var builder = new ApplyDynamicFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyFontColorFilter method. + /// + /// A + public Command BuildApplyFontColorFilterNavCommand() + { + var command = new Command("apply-font-color-filter"); + command.Description = "Provides operations to call the applyFontColorFilter method."; + var builder = new ApplyFontColorFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyIconFilter method. + /// + /// A + public Command BuildApplyIconFilterNavCommand() + { + var command = new Command("apply-icon-filter"); + command.Description = "Provides operations to call the applyIconFilter method."; + var builder = new ApplyIconFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the apply method. + /// + /// A + public Command BuildApplyNavCommand() + { + var command = new Command("apply"); + command.Description = "Provides operations to call the apply method."; + var builder = new ApplyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyTopItemsFilter method. + /// + /// A + public Command BuildApplyTopItemsFilterNavCommand() + { + var command = new Command("apply-top-items-filter"); + command.Description = "Provides operations to call the applyTopItemsFilter method."; + var builder = new ApplyTopItemsFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyTopPercentFilter method. + /// + /// A + public Command BuildApplyTopPercentFilterNavCommand() + { + var command = new Command("apply-top-percent-filter"); + command.Description = "Provides operations to call the applyTopPercentFilter method."; + var builder = new ApplyTopPercentFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyValuesFilter method. + /// + /// A + public Command BuildApplyValuesFilterNavCommand() + { + var command = new Command("apply-values-filter"); + command.Description = "Provides operations to call the applyValuesFilter method."; + var builder = new ApplyValuesFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property filter for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property filter for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Retrieve the filter applied to the column. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property filter in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property filter in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookFilter.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property filter for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property filter in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookFilter body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookFilter body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + public class FilterRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..663713b93b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.HeaderRowRange +{ + /// + /// Provides operations to call the headerRowRange method. + /// + public class HeaderRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the header row of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the header row of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-headerrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HeaderRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/headerRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HeaderRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/headerRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the header row of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..a8c2e8e1c5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the entire column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the entire column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/range()", rawUrl) + { + } + /// + /// Gets the range object associated with the entire column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..606201ea51 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.TotalRowRange +{ + /// + /// Provides operations to call the totalRowRange method. + /// + public class TotalRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the totals row of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the totals row of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-totalrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TotalRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/totalRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TotalRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/totalRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the totals row of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/WorkbookTableColumnItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/WorkbookTableColumnItemRequestBuilder.cs new file mode 100644 index 0000000000..f580b5cced --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/Item/WorkbookTableColumnItemRequestBuilder.cs @@ -0,0 +1,425 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.DataBodyRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.Filter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.HeaderRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item.TotalRowRange; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.Item +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + public class WorkbookTableColumnItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the dataBodyRange method. + /// + /// A + public Command BuildDataBodyRangeNavCommand() + { + var command = new Command("data-body-range"); + command.Description = "Provides operations to call the dataBodyRange method."; + var builder = new DataBodyRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property columns for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity. + /// + /// A + public Command BuildFilterNavCommand() + { + var command = new Command("filter"); + command.Description = "Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity."; + var builder = new FilterRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildApplyBottomItemsFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyBottomPercentFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyCellColorFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyCustomFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyDynamicFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyFontColorFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyIconFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyNavCommand()); + nonExecCommands.Add(builder.BuildApplyTopItemsFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyTopPercentFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyValuesFilterNavCommand()); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all the columns in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the headerRowRange method. + /// + /// A + public Command BuildHeaderRowRangeNavCommand() + { + var command = new Command("header-row-range"); + command.Description = "Provides operations to call the headerRowRange method."; + var builder = new HeaderRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property columns in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property columns in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableColumn.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the totalRowRange method. + /// + /// A + public Command BuildTotalRowRangeNavCommand() + { + var command = new Command("total-row-range"); + command.Description = "Provides operations to call the totalRowRange method."; + var builder = new TotalRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookTableColumnItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookTableColumnItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property columns for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property columns in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTableColumn body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTableColumn body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + public class WorkbookTableColumnItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs new file mode 100644 index 0000000000..a43749a47a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.DataBodyRange +{ + /// + /// Provides operations to call the dataBodyRange method. + /// + public class DataBodyRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the data body of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the data body of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-databodyrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataBodyRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/dataBodyRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataBodyRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/dataBodyRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the data body of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/Filter/FilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/Filter/FilterRequestBuilder.cs new file mode 100644 index 0000000000..67e9a25235 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/Filter/FilterRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.Filter +{ + /// + /// Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity. + /// + public class FilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property filter for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property filter for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Retrieve the filter applied to the column. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property filter in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property filter in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookFilter.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/filter{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/filter{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property filter for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property filter in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookFilter body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookFilter body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + public class FilterRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..3501722d5b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.HeaderRowRange +{ + /// + /// Provides operations to call the headerRowRange method. + /// + public class HeaderRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the header row of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the header row of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-headerrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HeaderRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/headerRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HeaderRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/headerRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the header row of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs new file mode 100644 index 0000000000..9e93026a27 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -0,0 +1,207 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.DataBodyRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.Filter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.HeaderRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.TotalRowRange; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex +{ + /// + /// Provides operations to call the itemAt method. + /// + public class ItemAtWithIndexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the dataBodyRange method. + /// + /// A + public Command BuildDataBodyRangeNavCommand() + { + var command = new Command("data-body-range"); + command.Description = "Provides operations to call the dataBodyRange method."; + var builder = new DataBodyRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity. + /// + /// A + public Command BuildFilterNavCommand() + { + var command = new Command("filter"); + command.Description = "Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity."; + var builder = new FilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Gets a column based on its position in the collection. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets a column based on its position in the collection.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumncollection-itemat?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the headerRowRange method. + /// + /// A + public Command BuildHeaderRowRangeNavCommand() + { + var command = new Command("header-row-range"); + command.Description = "Provides operations to call the headerRowRange method."; + var builder = new HeaderRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the totalRowRange method. + /// + /// A + public Command BuildTotalRowRangeNavCommand() + { + var command = new Command("total-row-range"); + command.Description = "Provides operations to call the totalRowRange method."; + var builder = new TotalRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemAtWithIndexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemAtWithIndexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})", rawUrl) + { + } + /// + /// Gets a column based on its position in the collection. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..cdef022190 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the entire column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the entire column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/range()", rawUrl) + { + } + /// + /// Gets the range object associated with the entire column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..8deeee1b91 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Columns/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns.ItemAtWithIndex.TotalRowRange +{ + /// + /// Provides operations to call the totalRowRange method. + /// + public class TotalRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the totals row of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the totals row of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-totalrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TotalRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/totalRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TotalRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/columns/itemAt(index={index})/totalRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the totals row of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs new file mode 100644 index 0000000000..ba02885f71 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.ConvertToRange +{ + /// + /// Provides operations to call the convertToRange method. + /// + public class ConvertToRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Converts the table into a normal range of cells. All data is preserved. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Converts the table into a normal range of cells. All data is preserved.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-converttorange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ConvertToRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/convertToRange", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ConvertToRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/convertToRange", rawUrl) + { + } + /// + /// Converts the table into a normal range of cells. All data is preserved. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs new file mode 100644 index 0000000000..7139977eb0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.DataBodyRange +{ + /// + /// Provides operations to call the dataBodyRange method. + /// + public class DataBodyRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the data body of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the data body of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-databodyrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataBodyRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/dataBodyRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataBodyRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/dataBodyRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the data body of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..be8195932f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.HeaderRowRange +{ + /// + /// Provides operations to call the headerRowRange method. + /// + public class HeaderRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with header row of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with header row of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-headerrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HeaderRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/headerRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HeaderRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/headerRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with header row of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..fbf3b6d0e3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the range object associated with the entire table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the range object associated with the entire table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/range()", rawUrl) + { + } + /// + /// Get the range object associated with the entire table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs new file mode 100644 index 0000000000..75c4476eb0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.ReapplyFilters +{ + /// + /// Provides operations to call the reapplyFilters method. + /// + public class ReapplyFiltersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Reapplies all the filters currently on the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Reapplies all the filters currently on the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-reapplyfilters?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReapplyFiltersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/reapplyFilters", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReapplyFiltersRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/reapplyFilters", rawUrl) + { + } + /// + /// Reapplies all the filters currently on the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..0868a5ed3a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Add/AddPostRequestBody.cs @@ -0,0 +1,67 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The index property + public int? Index { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "index", n => { Index = n.GetIntValue(); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("index", Index); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..2031fdac6c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Add/AddRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Adds rows to the end of the table. Note that the API can accept multiple rows data using this API. Adding one row at a time could lead to performance degradation. The recommended approach would be to batch the rows together in a single call rather than doing single row insertion. For best results, collect the rows to be inserted on the application side and perform single rows add operation. Experiment with the number of rows to determine the ideal number of rows to use in single API call. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Adds rows to the end of the table. Note that the API can accept multiple rows data using this API. Adding one row at a time could lead to performance degradation. The recommended approach would be to batch the rows together in a single call rather than doing single row insertion. For best results, collect the rows to be inserted on the application side and perform single rows add operation. Experiment with the number of rows to determine the ideal number of rows to use in single API call. \n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablerowcollection-add?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/add", rawUrl) + { + } + /// + /// Adds rows to the end of the table. Note that the API can accept multiple rows data using this API. Adding one row at a time could lead to performance degradation. The recommended approach would be to batch the rows together in a single call rather than doing single row insertion. For best results, collect the rows to be inserted on the application side and perform single rows add operation. Experiment with the number of rows to determine the ideal number of rows to use in single API call. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Count/CountGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Count/CountGetResponse.cs new file mode 100644 index 0000000000..330d7edc73 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Count/CountGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Count +{ + #pragma warning disable CS1591 + public class CountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public int? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..970a6b3b19 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Count/CountRequestBuilder.cs @@ -0,0 +1,107 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function count + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/count()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/count()", rawUrl) + { + } + /// + /// Invoke function count + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Item/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..f3cbaf5952 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Item/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,114 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Item.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function range + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function range"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbook-table-row-id", description: "The unique identifier of workbookTableRow") { + }; + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableRowId = invocationContext.ParseResult.GetValueForOption(workbookTableRowIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableRowId is not null) requestInfo.PathParameters.Add("workbookTableRow%2Did", workbookTableRowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/{workbookTableRow%2Did}/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/{workbookTableRow%2Did}/range()", rawUrl) + { + } + /// + /// Invoke function range + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Item/WorkbookTableRowItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Item/WorkbookTableRowItemRequestBuilder.cs new file mode 100644 index 0000000000..004afda86c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/Item/WorkbookTableRowItemRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Item.RangeNamespace; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Item +{ + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + public class WorkbookTableRowItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property rows for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property rows for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbook-table-row-id", description: "The unique identifier of workbookTableRow") { + }; + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableRowId = invocationContext.ParseResult.GetValueForOption(workbookTableRowIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableRowId is not null) requestInfo.PathParameters.Add("workbookTableRow%2Did", workbookTableRowId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all the rows in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbook-table-row-id", description: "The unique identifier of workbookTableRow") { + }; + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableRowId = invocationContext.ParseResult.GetValueForOption(workbookTableRowIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableRowId is not null) requestInfo.PathParameters.Add("workbookTableRow%2Did", workbookTableRowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property rows in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property rows in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbook-table-row-id", description: "The unique identifier of workbookTableRow") { + }; + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableRowId = invocationContext.ParseResult.GetValueForOption(workbookTableRowIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableRow.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableRowId is not null) requestInfo.PathParameters.Add("workbookTableRow%2Did", workbookTableRowId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookTableRowItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/{workbookTableRow%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookTableRowItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/{workbookTableRow%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property rows for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property rows in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTableRow body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTableRow body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + public class WorkbookTableRowItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs new file mode 100644 index 0000000000..9611b88909 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -0,0 +1,133 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.ItemAtWithIndex.RangeNamespace; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.ItemAtWithIndex +{ + /// + /// Provides operations to call the itemAt method. + /// + public class ItemAtWithIndexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets a row based on its position in the collection. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets a row based on its position in the collection.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablerowcollection-itemat?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemAtWithIndexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/itemAt(index={index})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemAtWithIndexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/itemAt(index={index})", rawUrl) + { + } + /// + /// Gets a row based on its position in the collection. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..d2d4981880 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,114 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.ItemAtWithIndex.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function range + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function range"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/itemAt(index={index})/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows/itemAt(index={index})/range()", rawUrl) + { + } + /// + /// Invoke function range + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/RowsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/RowsRequestBuilder.cs new file mode 100644 index 0000000000..8a1740921b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Rows/RowsRequestBuilder.cs @@ -0,0 +1,397 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows.ItemAtWithIndex; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows +{ + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + public class RowsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookTableRowItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRangeNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to rows for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to rows for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableRow.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the itemAt method. + /// + /// A + public Command BuildItemAtWithIndexRbCommand() + { + var command = new Command("item-at-with-index"); + command.Description = "Provides operations to call the itemAt method."; + var builder = new ItemAtWithIndexRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildRangeNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents a collection of all the rows in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RowsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RowsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/rows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to rows for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTableRow body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTableRow body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + public class RowsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Apply/ApplyPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Apply/ApplyPostRequestBody.cs new file mode 100644 index 0000000000..e5a52108b6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Apply/ApplyPostRequestBody.cs @@ -0,0 +1,77 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Sort.Apply +{ + #pragma warning disable CS1591 + public class ApplyPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fields property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Fields { get; set; } +#nullable restore +#else + public List Fields { get; set; } +#endif + /// The matchCase property + public bool? MatchCase { get; set; } + /// The method property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Method { get; set; } +#nullable restore +#else + public string Method { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fields", n => { Fields = n.GetCollectionOfObjectValues(WorkbookSortField.CreateFromDiscriminatorValue)?.ToList(); } }, + { "matchCase", n => { MatchCase = n.GetBoolValue(); } }, + { "method", n => { Method = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("fields", Fields); + writer.WriteBoolValue("matchCase", MatchCase); + writer.WriteStringValue("method", Method); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs new file mode 100644 index 0000000000..42e0d468ff --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Sort.Apply +{ + /// + /// Provides operations to call the apply method. + /// + public class ApplyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Perform a sort operation. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Perform a sort operation.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablesort-apply?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/sort/apply", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/sort/apply", rawUrl) + { + } + /// + /// Perform a sort operation. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..9d5de1252d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Clear/ClearRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Sort.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clears the sorting that is currently on the table. While this doesn't modify the table's ordering, it clears the state of the header buttons. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clears the sorting that is currently on the table. While this doesn't modify the table's ordering, it clears the state of the header buttons.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablesort-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/sort/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/sort/clear", rawUrl) + { + } + /// + /// Clears the sorting that is currently on the table. While this doesn't modify the table's ordering, it clears the state of the header buttons. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs new file mode 100644 index 0000000000..c9be6eecde --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Sort.Reapply +{ + /// + /// Provides operations to call the reapply method. + /// + public class ReapplyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Reapplies the current sorting parameters to the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Reapplies the current sorting parameters to the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablesort-reapply?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReapplyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/sort/reapply", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReapplyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/sort/reapply", rawUrl) + { + } + /// + /// Reapplies the current sorting parameters to the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/SortRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/SortRequestBuilder.cs new file mode 100644 index 0000000000..d594f06b37 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Sort/SortRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Sort.Apply; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Sort.Clear; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Sort.Reapply; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Sort +{ + /// + /// Provides operations to manage the sort property of the microsoft.graph.workbookTable entity. + /// + public class SortRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the apply method. + /// + /// A + public Command BuildApplyNavCommand() + { + var command = new Command("apply"); + command.Description = "Provides operations to call the apply method."; + var builder = new ApplyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property sort for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property sort for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the sorting for the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the sorting for the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property sort in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property sort in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableSort.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the reapply method. + /// + /// A + public Command BuildReapplyNavCommand() + { + var command = new Command("reapply"); + command.Description = "Provides operations to call the reapply method."; + var builder = new ReapplyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SortRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/sort{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SortRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/sort{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property sort for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the sorting for the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property sort in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTableSort body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTableSort body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the sorting for the table. Read-only. + /// + public class SortRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..46bd0c5139 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.TotalRowRange +{ + /// + /// Provides operations to call the totalRowRange method. + /// + public class TotalRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with totals row of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with totals row of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-totalrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TotalRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/totalRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TotalRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/totalRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with totals row of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/WorkbookTableItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/WorkbookTableItemRequestBuilder.cs new file mode 100644 index 0000000000..80dd0fd236 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/WorkbookTableItemRequestBuilder.cs @@ -0,0 +1,530 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.ClearFilters; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Columns; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.ConvertToRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.DataBodyRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.HeaderRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.ReapplyFilters; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Rows; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Sort; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.TotalRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item +{ + /// + /// Provides operations to manage the tables property of the microsoft.graph.workbook entity. + /// + public class WorkbookTableItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clearFilters method. + /// + /// A + public Command BuildClearFiltersNavCommand() + { + var command = new Command("clear-filters"); + command.Description = "Provides operations to call the clearFilters method."; + var builder = new ClearFiltersRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildColumnsNavCommand() + { + var command = new Command("columns"); + command.Description = "Provides operations to manage the columns property of the microsoft.graph.workbookTable entity."; + var builder = new ColumnsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildItemAtWithIndexRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the convertToRange method. + /// + /// A + public Command BuildConvertToRangeNavCommand() + { + var command = new Command("convert-to-range"); + command.Description = "Provides operations to call the convertToRange method."; + var builder = new ConvertToRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dataBodyRange method. + /// + /// A + public Command BuildDataBodyRangeNavCommand() + { + var command = new Command("data-body-range"); + command.Description = "Provides operations to call the dataBodyRange method."; + var builder = new DataBodyRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property tables for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property tables for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents a collection of tables associated with the workbook. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of tables associated with the workbook. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the headerRowRange method. + /// + /// A + public Command BuildHeaderRowRangeNavCommand() + { + var command = new Command("header-row-range"); + command.Description = "Provides operations to call the headerRowRange method."; + var builder = new HeaderRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property tables in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property tables in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTable.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the reapplyFilters method. + /// + /// A + public Command BuildReapplyFiltersNavCommand() + { + var command = new Command("reapply-filters"); + command.Description = "Provides operations to call the reapplyFilters method."; + var builder = new ReapplyFiltersRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildRowsNavCommand() + { + var command = new Command("rows"); + command.Description = "Provides operations to manage the rows property of the microsoft.graph.workbookTable entity."; + var builder = new RowsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildItemAtWithIndexRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the sort property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildSortNavCommand() + { + var command = new Command("sort"); + command.Description = "Provides operations to manage the sort property of the microsoft.graph.workbookTable entity."; + var builder = new SortRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildApplyNavCommand()); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildReapplyNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the totalRowRange method. + /// + /// A + public Command BuildTotalRowRangeNavCommand() + { + var command = new Command("total-row-range"); + command.Description = "Provides operations to call the totalRowRange method."; + var builder = new TotalRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookTableItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookTableItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property tables for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of tables associated with the workbook. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property tables in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTable body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTable body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of tables associated with the workbook. Read-only. + /// + public class WorkbookTableItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..68809a8170 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/Item/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,148 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// The worksheet containing the current table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The worksheet containing the current table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/{workbookTable%2Did}/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// The worksheet containing the current table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The worksheet containing the current table. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ClearFilters/ClearFiltersRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ClearFilters/ClearFiltersRequestBuilder.cs new file mode 100644 index 0000000000..7a93f42612 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ClearFilters/ClearFiltersRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.ClearFilters +{ + /// + /// Provides operations to call the clearFilters method. + /// + public class ClearFiltersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clears all the filters currently applied on the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clears all the filters currently applied on the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-clearfilters?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearFiltersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/clearFilters", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearFiltersRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/clearFilters", rawUrl) + { + } + /// + /// Clears all the filters currently applied on the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Columns/ColumnsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Columns/ColumnsRequestBuilder.cs new file mode 100644 index 0000000000..3ef79b72e8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Columns/ColumnsRequestBuilder.cs @@ -0,0 +1,321 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.Columns +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + public class ColumnsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all the columns in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Create new navigation property to columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableColumn.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTableColumn body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTableColumn body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + public class ColumnsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ConvertToRange/ConvertToRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ConvertToRange/ConvertToRangeRequestBuilder.cs new file mode 100644 index 0000000000..2e8c5546a9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ConvertToRange/ConvertToRangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.ConvertToRange +{ + /// + /// Provides operations to call the convertToRange method. + /// + public class ConvertToRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Converts the table into a normal range of cells. All data is preserved. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Converts the table into a normal range of cells. All data is preserved.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-converttorange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ConvertToRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/convertToRange", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ConvertToRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/convertToRange", rawUrl) + { + } + /// + /// Converts the table into a normal range of cells. All data is preserved. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs new file mode 100644 index 0000000000..4fe26f88f2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.DataBodyRange +{ + /// + /// Provides operations to call the dataBodyRange method. + /// + public class DataBodyRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the data body of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the data body of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-databodyrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataBodyRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/dataBodyRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataBodyRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/dataBodyRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the data body of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..e327417776 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.HeaderRowRange +{ + /// + /// Provides operations to call the headerRowRange method. + /// + public class HeaderRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with header row of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with header row of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-headerrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HeaderRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/headerRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HeaderRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/headerRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with header row of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs new file mode 100644 index 0000000000..03ca7611e2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -0,0 +1,310 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.ClearFilters; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.Columns; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.ConvertToRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.DataBodyRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.HeaderRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.ReapplyFilters; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.Rows; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.Sort; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.TotalRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex +{ + /// + /// Provides operations to call the itemAt method. + /// + public class ItemAtWithIndexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clearFilters method. + /// + /// A + public Command BuildClearFiltersNavCommand() + { + var command = new Command("clear-filters"); + command.Description = "Provides operations to call the clearFilters method."; + var builder = new ClearFiltersRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildColumnsNavCommand() + { + var command = new Command("columns"); + command.Description = "Provides operations to manage the columns property of the microsoft.graph.workbookTable entity."; + var builder = new ColumnsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the convertToRange method. + /// + /// A + public Command BuildConvertToRangeNavCommand() + { + var command = new Command("convert-to-range"); + command.Description = "Provides operations to call the convertToRange method."; + var builder = new ConvertToRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dataBodyRange method. + /// + /// A + public Command BuildDataBodyRangeNavCommand() + { + var command = new Command("data-body-range"); + command.Description = "Provides operations to call the dataBodyRange method."; + var builder = new DataBodyRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Invoke function itemAt + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function itemAt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the headerRowRange method. + /// + /// A + public Command BuildHeaderRowRangeNavCommand() + { + var command = new Command("header-row-range"); + command.Description = "Provides operations to call the headerRowRange method."; + var builder = new HeaderRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the reapplyFilters method. + /// + /// A + public Command BuildReapplyFiltersNavCommand() + { + var command = new Command("reapply-filters"); + command.Description = "Provides operations to call the reapplyFilters method."; + var builder = new ReapplyFiltersRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildRowsNavCommand() + { + var command = new Command("rows"); + command.Description = "Provides operations to manage the rows property of the microsoft.graph.workbookTable entity."; + var builder = new RowsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the sort property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildSortNavCommand() + { + var command = new Command("sort"); + command.Description = "Provides operations to manage the sort property of the microsoft.graph.workbookTable entity."; + var builder = new SortRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the totalRowRange method. + /// + /// A + public Command BuildTotalRowRangeNavCommand() + { + var command = new Command("total-row-range"); + command.Description = "Provides operations to call the totalRowRange method."; + var builder = new TotalRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemAtWithIndexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemAtWithIndexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})", rawUrl) + { + } + /// + /// Invoke function itemAt + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..a0b094b391 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the range object associated with the entire table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the range object associated with the entire table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/range()", rawUrl) + { + } + /// + /// Get the range object associated with the entire table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ReapplyFilters/ReapplyFiltersRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ReapplyFilters/ReapplyFiltersRequestBuilder.cs new file mode 100644 index 0000000000..907e01c06a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/ReapplyFilters/ReapplyFiltersRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.ReapplyFilters +{ + /// + /// Provides operations to call the reapplyFilters method. + /// + public class ReapplyFiltersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Reapplies all the filters currently on the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Reapplies all the filters currently on the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-reapplyfilters?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReapplyFiltersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/reapplyFilters", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReapplyFiltersRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/reapplyFilters", rawUrl) + { + } + /// + /// Reapplies all the filters currently on the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Rows/RowsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Rows/RowsRequestBuilder.cs new file mode 100644 index 0000000000..babac98149 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Rows/RowsRequestBuilder.cs @@ -0,0 +1,321 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.Rows +{ + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + public class RowsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all the rows in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Create new navigation property to rows for storage + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Create new navigation property to rows for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableRow.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RowsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/rows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RowsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/rows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to rows for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTableRow body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTableRow body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + public class RowsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Sort/SortRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Sort/SortRequestBuilder.cs new file mode 100644 index 0000000000..9f24fdc552 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Sort/SortRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.Sort +{ + /// + /// Provides operations to manage the sort property of the microsoft.graph.workbookTable entity. + /// + public class SortRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property sort for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property sort for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the sorting for the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the sorting for the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property sort in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property sort in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableSort.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SortRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/sort{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SortRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/sort{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property sort for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the sorting for the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property sort in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTableSort body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTableSort body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the sorting for the table. Read-only. + /// + public class SortRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..ceb9dea2b2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.TotalRowRange +{ + /// + /// Provides operations to call the totalRowRange method. + /// + public class TotalRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with totals row of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with totals row of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-totalrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TotalRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/totalRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TotalRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/totalRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with totals row of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..b8269618d3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/ItemAtWithIndex/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,148 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// The worksheet containing the current table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The worksheet containing the current table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables/itemAt(index={index})/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// The worksheet containing the current table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The worksheet containing the current table. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/TablesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/TablesRequestBuilder.cs new file mode 100644 index 0000000000..0cc9ead0db --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Tables/TablesRequestBuilder.cs @@ -0,0 +1,405 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables.ItemAtWithIndex; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables +{ + /// + /// Provides operations to manage the tables property of the microsoft.graph.workbook entity. + /// + public class TablesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the tables property of the microsoft.graph.workbook entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookTableItemRequestBuilder(PathParameters); + commands.Add(builder.BuildClearFiltersNavCommand()); + commands.Add(builder.BuildColumnsNavCommand()); + commands.Add(builder.BuildConvertToRangeNavCommand()); + commands.Add(builder.BuildDataBodyRangeNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildHeaderRowRangeNavCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRangeNavCommand()); + commands.Add(builder.BuildReapplyFiltersNavCommand()); + commands.Add(builder.BuildRowsNavCommand()); + commands.Add(builder.BuildSortNavCommand()); + commands.Add(builder.BuildTotalRowRangeNavCommand()); + commands.Add(builder.BuildWorksheetNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to tables for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to tables for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTable.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the itemAt method. + /// + /// A + public Command BuildItemAtWithIndexRbCommand() + { + var command = new Command("item-at-with-index"); + command.Description = "Provides operations to call the itemAt method."; + var builder = new ItemAtWithIndexRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearFiltersNavCommand()); + nonExecCommands.Add(builder.BuildColumnsNavCommand()); + nonExecCommands.Add(builder.BuildConvertToRangeNavCommand()); + nonExecCommands.Add(builder.BuildDataBodyRangeNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildHeaderRowRangeNavCommand()); + nonExecCommands.Add(builder.BuildRangeNavCommand()); + nonExecCommands.Add(builder.BuildReapplyFiltersNavCommand()); + nonExecCommands.Add(builder.BuildRowsNavCommand()); + nonExecCommands.Add(builder.BuildSortNavCommand()); + nonExecCommands.Add(builder.BuildTotalRowRangeNavCommand()); + nonExecCommands.Add(builder.BuildWorksheetNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents a collection of tables associated with the workbook. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents a collection of tables associated with the workbook. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TablesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TablesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/tables{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of tables associated with the workbook. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to tables for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTable body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTable body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of tables associated with the workbook. Read-only. + /// + public class TablesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/WorkbookRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/WorkbookRequestBuilder.cs new file mode 100644 index 0000000000..f224523fe7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/WorkbookRequestBuilder.cs @@ -0,0 +1,931 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Application; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.CloseSession; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Comments; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.CreateSession; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Functions; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Names; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Operations; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.RefreshSession; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.SessionInfoResourceWithKey; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.TableRowOperationResultWithKey; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Tables; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook +{ + /// + /// Provides operations to manage the workbook property of the microsoft.graph.driveItem entity. + /// + public class WorkbookRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the application property of the microsoft.graph.workbook entity. + /// + /// A + public Command BuildApplicationNavCommand() + { + var command = new Command("application"); + command.Description = "Provides operations to manage the application property of the microsoft.graph.workbook entity."; + var builder = new ApplicationRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCalculateNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the closeSession method. + /// + /// A + public Command BuildCloseSessionNavCommand() + { + var command = new Command("close-session"); + command.Description = "Provides operations to call the closeSession method."; + var builder = new CloseSessionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the comments property of the microsoft.graph.workbook entity. + /// + /// A + public Command BuildCommentsNavCommand() + { + var command = new Command("comments"); + command.Description = "Provides operations to manage the comments property of the microsoft.graph.workbook entity."; + var builder = new CommentsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the createSession method. + /// + /// A + public Command BuildCreateSessionNavCommand() + { + var command = new Command("create-session"); + command.Description = "Provides operations to call the createSession method."; + var builder = new CreateSessionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property workbook for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property workbook for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the functions property of the microsoft.graph.workbook entity. + /// + /// A + public Command BuildFunctionsNavCommand() + { + var command = new Command("functions"); + command.Description = "Provides operations to manage the functions property of the microsoft.graph.workbook entity."; + var builder = new FunctionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAbsNavCommand()); + nonExecCommands.Add(builder.BuildAccrIntMNavCommand()); + nonExecCommands.Add(builder.BuildAccrIntNavCommand()); + nonExecCommands.Add(builder.BuildAcoshNavCommand()); + nonExecCommands.Add(builder.BuildAcosNavCommand()); + nonExecCommands.Add(builder.BuildAcothNavCommand()); + nonExecCommands.Add(builder.BuildAcotNavCommand()); + nonExecCommands.Add(builder.BuildAmorDegrcNavCommand()); + nonExecCommands.Add(builder.BuildAmorLincNavCommand()); + nonExecCommands.Add(builder.BuildAndNavCommand()); + nonExecCommands.Add(builder.BuildArabicNavCommand()); + nonExecCommands.Add(builder.BuildAreasNavCommand()); + nonExecCommands.Add(builder.BuildAscNavCommand()); + nonExecCommands.Add(builder.BuildAsinhNavCommand()); + nonExecCommands.Add(builder.BuildAsinNavCommand()); + nonExecCommands.Add(builder.BuildAtan2NavCommand()); + nonExecCommands.Add(builder.BuildAtanhNavCommand()); + nonExecCommands.Add(builder.BuildAtanNavCommand()); + nonExecCommands.Add(builder.BuildAveDevNavCommand()); + nonExecCommands.Add(builder.BuildAverageANavCommand()); + nonExecCommands.Add(builder.BuildAverageIfNavCommand()); + nonExecCommands.Add(builder.BuildAverageIfsNavCommand()); + nonExecCommands.Add(builder.BuildAverageNavCommand()); + nonExecCommands.Add(builder.BuildBahtTextNavCommand()); + nonExecCommands.Add(builder.BuildBaseNavCommand()); + nonExecCommands.Add(builder.BuildBesselINavCommand()); + nonExecCommands.Add(builder.BuildBesselJNavCommand()); + nonExecCommands.Add(builder.BuildBesselKNavCommand()); + nonExecCommands.Add(builder.BuildBesselYNavCommand()); + nonExecCommands.Add(builder.BuildBeta_DistNavCommand()); + nonExecCommands.Add(builder.BuildBeta_InvNavCommand()); + nonExecCommands.Add(builder.BuildBin2DecNavCommand()); + nonExecCommands.Add(builder.BuildBin2HexNavCommand()); + nonExecCommands.Add(builder.BuildBin2OctNavCommand()); + nonExecCommands.Add(builder.BuildBinom_DistNavCommand()); + nonExecCommands.Add(builder.BuildBinom_Dist_RangeNavCommand()); + nonExecCommands.Add(builder.BuildBinom_InvNavCommand()); + nonExecCommands.Add(builder.BuildBitandNavCommand()); + nonExecCommands.Add(builder.BuildBitlshiftNavCommand()); + nonExecCommands.Add(builder.BuildBitorNavCommand()); + nonExecCommands.Add(builder.BuildBitrshiftNavCommand()); + nonExecCommands.Add(builder.BuildBitxorNavCommand()); + nonExecCommands.Add(builder.BuildCeiling_MathNavCommand()); + nonExecCommands.Add(builder.BuildCeiling_PreciseNavCommand()); + nonExecCommands.Add(builder.BuildCharNavCommand()); + nonExecCommands.Add(builder.BuildChiSq_DistNavCommand()); + nonExecCommands.Add(builder.BuildChiSq_Dist_RTNavCommand()); + nonExecCommands.Add(builder.BuildChiSq_InvNavCommand()); + nonExecCommands.Add(builder.BuildChiSq_Inv_RTNavCommand()); + nonExecCommands.Add(builder.BuildChooseNavCommand()); + nonExecCommands.Add(builder.BuildCleanNavCommand()); + nonExecCommands.Add(builder.BuildCodeNavCommand()); + nonExecCommands.Add(builder.BuildColumnsNavCommand()); + nonExecCommands.Add(builder.BuildCombinaNavCommand()); + nonExecCommands.Add(builder.BuildCombinNavCommand()); + nonExecCommands.Add(builder.BuildComplexNavCommand()); + nonExecCommands.Add(builder.BuildConcatenateNavCommand()); + nonExecCommands.Add(builder.BuildConfidence_NormNavCommand()); + nonExecCommands.Add(builder.BuildConfidence_TNavCommand()); + nonExecCommands.Add(builder.BuildConvertNavCommand()); + nonExecCommands.Add(builder.BuildCoshNavCommand()); + nonExecCommands.Add(builder.BuildCosNavCommand()); + nonExecCommands.Add(builder.BuildCothNavCommand()); + nonExecCommands.Add(builder.BuildCotNavCommand()); + nonExecCommands.Add(builder.BuildCountANavCommand()); + nonExecCommands.Add(builder.BuildCountBlankNavCommand()); + nonExecCommands.Add(builder.BuildCountIfNavCommand()); + nonExecCommands.Add(builder.BuildCountIfsNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + nonExecCommands.Add(builder.BuildCoupDayBsNavCommand()); + nonExecCommands.Add(builder.BuildCoupDaysNavCommand()); + nonExecCommands.Add(builder.BuildCoupDaysNcNavCommand()); + nonExecCommands.Add(builder.BuildCoupNcdNavCommand()); + nonExecCommands.Add(builder.BuildCoupNumNavCommand()); + nonExecCommands.Add(builder.BuildCoupPcdNavCommand()); + nonExecCommands.Add(builder.BuildCschNavCommand()); + nonExecCommands.Add(builder.BuildCscNavCommand()); + nonExecCommands.Add(builder.BuildCumIPmtNavCommand()); + nonExecCommands.Add(builder.BuildCumPrincNavCommand()); + nonExecCommands.Add(builder.BuildDateNavCommand()); + nonExecCommands.Add(builder.BuildDatevalueNavCommand()); + nonExecCommands.Add(builder.BuildDaverageNavCommand()); + nonExecCommands.Add(builder.BuildDayNavCommand()); + nonExecCommands.Add(builder.BuildDays360NavCommand()); + nonExecCommands.Add(builder.BuildDaysNavCommand()); + nonExecCommands.Add(builder.BuildDbcsNavCommand()); + nonExecCommands.Add(builder.BuildDbNavCommand()); + nonExecCommands.Add(builder.BuildDcountANavCommand()); + nonExecCommands.Add(builder.BuildDcountNavCommand()); + nonExecCommands.Add(builder.BuildDdbNavCommand()); + nonExecCommands.Add(builder.BuildDec2BinNavCommand()); + nonExecCommands.Add(builder.BuildDec2HexNavCommand()); + nonExecCommands.Add(builder.BuildDec2OctNavCommand()); + nonExecCommands.Add(builder.BuildDecimalNavCommand()); + nonExecCommands.Add(builder.BuildDegreesNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildDeltaNavCommand()); + nonExecCommands.Add(builder.BuildDevSqNavCommand()); + nonExecCommands.Add(builder.BuildDgetNavCommand()); + nonExecCommands.Add(builder.BuildDiscNavCommand()); + nonExecCommands.Add(builder.BuildDmaxNavCommand()); + nonExecCommands.Add(builder.BuildDminNavCommand()); + nonExecCommands.Add(builder.BuildDollarDeNavCommand()); + nonExecCommands.Add(builder.BuildDollarFrNavCommand()); + nonExecCommands.Add(builder.BuildDollarNavCommand()); + nonExecCommands.Add(builder.BuildDproductNavCommand()); + nonExecCommands.Add(builder.BuildDstDevNavCommand()); + nonExecCommands.Add(builder.BuildDstDevPNavCommand()); + nonExecCommands.Add(builder.BuildDsumNavCommand()); + nonExecCommands.Add(builder.BuildDurationNavCommand()); + nonExecCommands.Add(builder.BuildDvarNavCommand()); + nonExecCommands.Add(builder.BuildDvarPNavCommand()); + nonExecCommands.Add(builder.BuildEcma_CeilingNavCommand()); + nonExecCommands.Add(builder.BuildEdateNavCommand()); + nonExecCommands.Add(builder.BuildEffectNavCommand()); + nonExecCommands.Add(builder.BuildEoMonthNavCommand()); + nonExecCommands.Add(builder.BuildErfCNavCommand()); + nonExecCommands.Add(builder.BuildErfC_PreciseNavCommand()); + nonExecCommands.Add(builder.BuildErfNavCommand()); + nonExecCommands.Add(builder.BuildErf_PreciseNavCommand()); + nonExecCommands.Add(builder.BuildError_TypeNavCommand()); + nonExecCommands.Add(builder.BuildEvenNavCommand()); + nonExecCommands.Add(builder.BuildExactNavCommand()); + nonExecCommands.Add(builder.BuildExpNavCommand()); + nonExecCommands.Add(builder.BuildExpon_DistNavCommand()); + nonExecCommands.Add(builder.BuildFactDoubleNavCommand()); + nonExecCommands.Add(builder.BuildFactNavCommand()); + nonExecCommands.Add(builder.BuildFalseNavCommand()); + nonExecCommands.Add(builder.BuildFindBNavCommand()); + nonExecCommands.Add(builder.BuildFindNavCommand()); + nonExecCommands.Add(builder.BuildFisherInvNavCommand()); + nonExecCommands.Add(builder.BuildFisherNavCommand()); + nonExecCommands.Add(builder.BuildFixedNavCommand()); + nonExecCommands.Add(builder.BuildFloor_MathNavCommand()); + nonExecCommands.Add(builder.BuildFloor_PreciseNavCommand()); + nonExecCommands.Add(builder.BuildFvNavCommand()); + nonExecCommands.Add(builder.BuildFvscheduleNavCommand()); + nonExecCommands.Add(builder.BuildF_DistNavCommand()); + nonExecCommands.Add(builder.BuildF_Dist_RTNavCommand()); + nonExecCommands.Add(builder.BuildF_InvNavCommand()); + nonExecCommands.Add(builder.BuildF_Inv_RTNavCommand()); + nonExecCommands.Add(builder.BuildGammaLnNavCommand()); + nonExecCommands.Add(builder.BuildGammaLn_PreciseNavCommand()); + nonExecCommands.Add(builder.BuildGammaNavCommand()); + nonExecCommands.Add(builder.BuildGamma_DistNavCommand()); + nonExecCommands.Add(builder.BuildGamma_InvNavCommand()); + nonExecCommands.Add(builder.BuildGaussNavCommand()); + nonExecCommands.Add(builder.BuildGcdNavCommand()); + nonExecCommands.Add(builder.BuildGeoMeanNavCommand()); + nonExecCommands.Add(builder.BuildGeStepNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildHarMeanNavCommand()); + nonExecCommands.Add(builder.BuildHex2BinNavCommand()); + nonExecCommands.Add(builder.BuildHex2DecNavCommand()); + nonExecCommands.Add(builder.BuildHex2OctNavCommand()); + nonExecCommands.Add(builder.BuildHlookupNavCommand()); + nonExecCommands.Add(builder.BuildHourNavCommand()); + nonExecCommands.Add(builder.BuildHyperlinkNavCommand()); + nonExecCommands.Add(builder.BuildHypGeom_DistNavCommand()); + nonExecCommands.Add(builder.BuildIfNavCommand()); + nonExecCommands.Add(builder.BuildImAbsNavCommand()); + nonExecCommands.Add(builder.BuildImaginaryNavCommand()); + nonExecCommands.Add(builder.BuildImArgumentNavCommand()); + nonExecCommands.Add(builder.BuildImConjugateNavCommand()); + nonExecCommands.Add(builder.BuildImCoshNavCommand()); + nonExecCommands.Add(builder.BuildImCosNavCommand()); + nonExecCommands.Add(builder.BuildImCotNavCommand()); + nonExecCommands.Add(builder.BuildImCschNavCommand()); + nonExecCommands.Add(builder.BuildImCscNavCommand()); + nonExecCommands.Add(builder.BuildImDivNavCommand()); + nonExecCommands.Add(builder.BuildImExpNavCommand()); + nonExecCommands.Add(builder.BuildImLnNavCommand()); + nonExecCommands.Add(builder.BuildImLog10NavCommand()); + nonExecCommands.Add(builder.BuildImLog2NavCommand()); + nonExecCommands.Add(builder.BuildImPowerNavCommand()); + nonExecCommands.Add(builder.BuildImProductNavCommand()); + nonExecCommands.Add(builder.BuildImRealNavCommand()); + nonExecCommands.Add(builder.BuildImSechNavCommand()); + nonExecCommands.Add(builder.BuildImSecNavCommand()); + nonExecCommands.Add(builder.BuildImSinhNavCommand()); + nonExecCommands.Add(builder.BuildImSinNavCommand()); + nonExecCommands.Add(builder.BuildImSqrtNavCommand()); + nonExecCommands.Add(builder.BuildImSubNavCommand()); + nonExecCommands.Add(builder.BuildImSumNavCommand()); + nonExecCommands.Add(builder.BuildImTanNavCommand()); + nonExecCommands.Add(builder.BuildIntNavCommand()); + nonExecCommands.Add(builder.BuildIntRateNavCommand()); + nonExecCommands.Add(builder.BuildIpmtNavCommand()); + nonExecCommands.Add(builder.BuildIrrNavCommand()); + nonExecCommands.Add(builder.BuildIsErrNavCommand()); + nonExecCommands.Add(builder.BuildIsErrorNavCommand()); + nonExecCommands.Add(builder.BuildIsEvenNavCommand()); + nonExecCommands.Add(builder.BuildIsFormulaNavCommand()); + nonExecCommands.Add(builder.BuildIsLogicalNavCommand()); + nonExecCommands.Add(builder.BuildIsNANavCommand()); + nonExecCommands.Add(builder.BuildIsNonTextNavCommand()); + nonExecCommands.Add(builder.BuildIsNumberNavCommand()); + nonExecCommands.Add(builder.BuildIsOddNavCommand()); + nonExecCommands.Add(builder.BuildIsoWeekNumNavCommand()); + nonExecCommands.Add(builder.BuildIso_CeilingNavCommand()); + nonExecCommands.Add(builder.BuildIspmtNavCommand()); + nonExecCommands.Add(builder.BuildIsrefNavCommand()); + nonExecCommands.Add(builder.BuildIsTextNavCommand()); + nonExecCommands.Add(builder.BuildKurtNavCommand()); + nonExecCommands.Add(builder.BuildLargeNavCommand()); + nonExecCommands.Add(builder.BuildLcmNavCommand()); + nonExecCommands.Add(builder.BuildLeftbNavCommand()); + nonExecCommands.Add(builder.BuildLeftNavCommand()); + nonExecCommands.Add(builder.BuildLenbNavCommand()); + nonExecCommands.Add(builder.BuildLenNavCommand()); + nonExecCommands.Add(builder.BuildLnNavCommand()); + nonExecCommands.Add(builder.BuildLog10NavCommand()); + nonExecCommands.Add(builder.BuildLogNavCommand()); + nonExecCommands.Add(builder.BuildLogNorm_DistNavCommand()); + nonExecCommands.Add(builder.BuildLogNorm_InvNavCommand()); + nonExecCommands.Add(builder.BuildLookupNavCommand()); + nonExecCommands.Add(builder.BuildLowerNavCommand()); + nonExecCommands.Add(builder.BuildMatchNavCommand()); + nonExecCommands.Add(builder.BuildMaxANavCommand()); + nonExecCommands.Add(builder.BuildMaxNavCommand()); + nonExecCommands.Add(builder.BuildMdurationNavCommand()); + nonExecCommands.Add(builder.BuildMedianNavCommand()); + nonExecCommands.Add(builder.BuildMidbNavCommand()); + nonExecCommands.Add(builder.BuildMidNavCommand()); + nonExecCommands.Add(builder.BuildMinANavCommand()); + nonExecCommands.Add(builder.BuildMinNavCommand()); + nonExecCommands.Add(builder.BuildMinuteNavCommand()); + nonExecCommands.Add(builder.BuildMirrNavCommand()); + nonExecCommands.Add(builder.BuildModNavCommand()); + nonExecCommands.Add(builder.BuildMonthNavCommand()); + nonExecCommands.Add(builder.BuildMroundNavCommand()); + nonExecCommands.Add(builder.BuildMultiNomialNavCommand()); + nonExecCommands.Add(builder.BuildNaNavCommand()); + nonExecCommands.Add(builder.BuildNegBinom_DistNavCommand()); + nonExecCommands.Add(builder.BuildNetworkDaysNavCommand()); + nonExecCommands.Add(builder.BuildNetworkDays_IntlNavCommand()); + nonExecCommands.Add(builder.BuildNNavCommand()); + nonExecCommands.Add(builder.BuildNominalNavCommand()); + nonExecCommands.Add(builder.BuildNorm_DistNavCommand()); + nonExecCommands.Add(builder.BuildNorm_InvNavCommand()); + nonExecCommands.Add(builder.BuildNorm_S_DistNavCommand()); + nonExecCommands.Add(builder.BuildNorm_S_InvNavCommand()); + nonExecCommands.Add(builder.BuildNotNavCommand()); + nonExecCommands.Add(builder.BuildNowNavCommand()); + nonExecCommands.Add(builder.BuildNperNavCommand()); + nonExecCommands.Add(builder.BuildNpvNavCommand()); + nonExecCommands.Add(builder.BuildNumberValueNavCommand()); + nonExecCommands.Add(builder.BuildOct2BinNavCommand()); + nonExecCommands.Add(builder.BuildOct2DecNavCommand()); + nonExecCommands.Add(builder.BuildOct2HexNavCommand()); + nonExecCommands.Add(builder.BuildOddFPriceNavCommand()); + nonExecCommands.Add(builder.BuildOddFYieldNavCommand()); + nonExecCommands.Add(builder.BuildOddLPriceNavCommand()); + nonExecCommands.Add(builder.BuildOddLYieldNavCommand()); + nonExecCommands.Add(builder.BuildOddNavCommand()); + nonExecCommands.Add(builder.BuildOrNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildPdurationNavCommand()); + nonExecCommands.Add(builder.BuildPercentile_ExcNavCommand()); + nonExecCommands.Add(builder.BuildPercentile_IncNavCommand()); + nonExecCommands.Add(builder.BuildPercentRank_ExcNavCommand()); + nonExecCommands.Add(builder.BuildPercentRank_IncNavCommand()); + nonExecCommands.Add(builder.BuildPermutationaNavCommand()); + nonExecCommands.Add(builder.BuildPermutNavCommand()); + nonExecCommands.Add(builder.BuildPhiNavCommand()); + nonExecCommands.Add(builder.BuildPiNavCommand()); + nonExecCommands.Add(builder.BuildPmtNavCommand()); + nonExecCommands.Add(builder.BuildPoisson_DistNavCommand()); + nonExecCommands.Add(builder.BuildPowerNavCommand()); + nonExecCommands.Add(builder.BuildPpmtNavCommand()); + nonExecCommands.Add(builder.BuildPriceDiscNavCommand()); + nonExecCommands.Add(builder.BuildPriceMatNavCommand()); + nonExecCommands.Add(builder.BuildPriceNavCommand()); + nonExecCommands.Add(builder.BuildProductNavCommand()); + nonExecCommands.Add(builder.BuildProperNavCommand()); + nonExecCommands.Add(builder.BuildPvNavCommand()); + nonExecCommands.Add(builder.BuildQuartile_ExcNavCommand()); + nonExecCommands.Add(builder.BuildQuartile_IncNavCommand()); + nonExecCommands.Add(builder.BuildQuotientNavCommand()); + nonExecCommands.Add(builder.BuildRadiansNavCommand()); + nonExecCommands.Add(builder.BuildRandBetweenNavCommand()); + nonExecCommands.Add(builder.BuildRandNavCommand()); + nonExecCommands.Add(builder.BuildRank_AvgNavCommand()); + nonExecCommands.Add(builder.BuildRank_EqNavCommand()); + nonExecCommands.Add(builder.BuildRateNavCommand()); + nonExecCommands.Add(builder.BuildReceivedNavCommand()); + nonExecCommands.Add(builder.BuildReplaceBNavCommand()); + nonExecCommands.Add(builder.BuildReplaceNavCommand()); + nonExecCommands.Add(builder.BuildReptNavCommand()); + nonExecCommands.Add(builder.BuildRightbNavCommand()); + nonExecCommands.Add(builder.BuildRightNavCommand()); + nonExecCommands.Add(builder.BuildRomanNavCommand()); + nonExecCommands.Add(builder.BuildRoundDownNavCommand()); + nonExecCommands.Add(builder.BuildRoundNavCommand()); + nonExecCommands.Add(builder.BuildRoundUpNavCommand()); + nonExecCommands.Add(builder.BuildRowsNavCommand()); + nonExecCommands.Add(builder.BuildRriNavCommand()); + nonExecCommands.Add(builder.BuildSechNavCommand()); + nonExecCommands.Add(builder.BuildSecNavCommand()); + nonExecCommands.Add(builder.BuildSecondNavCommand()); + nonExecCommands.Add(builder.BuildSeriesSumNavCommand()); + nonExecCommands.Add(builder.BuildSheetNavCommand()); + nonExecCommands.Add(builder.BuildSheetsNavCommand()); + nonExecCommands.Add(builder.BuildSignNavCommand()); + nonExecCommands.Add(builder.BuildSinhNavCommand()); + nonExecCommands.Add(builder.BuildSinNavCommand()); + nonExecCommands.Add(builder.BuildSkewNavCommand()); + nonExecCommands.Add(builder.BuildSkew_pNavCommand()); + nonExecCommands.Add(builder.BuildSlnNavCommand()); + nonExecCommands.Add(builder.BuildSmallNavCommand()); + nonExecCommands.Add(builder.BuildSqrtNavCommand()); + nonExecCommands.Add(builder.BuildSqrtPiNavCommand()); + nonExecCommands.Add(builder.BuildStandardizeNavCommand()); + nonExecCommands.Add(builder.BuildStDevANavCommand()); + nonExecCommands.Add(builder.BuildStDevPANavCommand()); + nonExecCommands.Add(builder.BuildStDev_PNavCommand()); + nonExecCommands.Add(builder.BuildStDev_SNavCommand()); + nonExecCommands.Add(builder.BuildSubstituteNavCommand()); + nonExecCommands.Add(builder.BuildSubtotalNavCommand()); + nonExecCommands.Add(builder.BuildSumIfNavCommand()); + nonExecCommands.Add(builder.BuildSumIfsNavCommand()); + nonExecCommands.Add(builder.BuildSumNavCommand()); + nonExecCommands.Add(builder.BuildSumSqNavCommand()); + nonExecCommands.Add(builder.BuildSydNavCommand()); + nonExecCommands.Add(builder.BuildTanhNavCommand()); + nonExecCommands.Add(builder.BuildTanNavCommand()); + nonExecCommands.Add(builder.BuildTbillEqNavCommand()); + nonExecCommands.Add(builder.BuildTbillPriceNavCommand()); + nonExecCommands.Add(builder.BuildTbillYieldNavCommand()); + nonExecCommands.Add(builder.BuildTextNavCommand()); + nonExecCommands.Add(builder.BuildTimeNavCommand()); + nonExecCommands.Add(builder.BuildTimevalueNavCommand()); + nonExecCommands.Add(builder.BuildTNavCommand()); + nonExecCommands.Add(builder.BuildTodayNavCommand()); + nonExecCommands.Add(builder.BuildTrimMeanNavCommand()); + nonExecCommands.Add(builder.BuildTrimNavCommand()); + nonExecCommands.Add(builder.BuildTrueNavCommand()); + nonExecCommands.Add(builder.BuildTruncNavCommand()); + nonExecCommands.Add(builder.BuildTypeNavCommand()); + nonExecCommands.Add(builder.BuildT_DistNavCommand()); + nonExecCommands.Add(builder.BuildT_Dist_2TNavCommand()); + nonExecCommands.Add(builder.BuildT_Dist_RTNavCommand()); + nonExecCommands.Add(builder.BuildT_InvNavCommand()); + nonExecCommands.Add(builder.BuildT_Inv_2TNavCommand()); + nonExecCommands.Add(builder.BuildUnicharNavCommand()); + nonExecCommands.Add(builder.BuildUnicodeNavCommand()); + nonExecCommands.Add(builder.BuildUpperNavCommand()); + nonExecCommands.Add(builder.BuildUsdollarNavCommand()); + nonExecCommands.Add(builder.BuildValueNavCommand()); + nonExecCommands.Add(builder.BuildVarANavCommand()); + nonExecCommands.Add(builder.BuildVarPANavCommand()); + nonExecCommands.Add(builder.BuildVar_PNavCommand()); + nonExecCommands.Add(builder.BuildVar_SNavCommand()); + nonExecCommands.Add(builder.BuildVdbNavCommand()); + nonExecCommands.Add(builder.BuildVlookupNavCommand()); + nonExecCommands.Add(builder.BuildWeekdayNavCommand()); + nonExecCommands.Add(builder.BuildWeekNumNavCommand()); + nonExecCommands.Add(builder.BuildWeibull_DistNavCommand()); + nonExecCommands.Add(builder.BuildWorkDayNavCommand()); + nonExecCommands.Add(builder.BuildWorkDay_IntlNavCommand()); + nonExecCommands.Add(builder.BuildXirrNavCommand()); + nonExecCommands.Add(builder.BuildXnpvNavCommand()); + nonExecCommands.Add(builder.BuildXorNavCommand()); + nonExecCommands.Add(builder.BuildYearFracNavCommand()); + nonExecCommands.Add(builder.BuildYearNavCommand()); + nonExecCommands.Add(builder.BuildYieldDiscNavCommand()); + nonExecCommands.Add(builder.BuildYieldMatNavCommand()); + nonExecCommands.Add(builder.BuildYieldNavCommand()); + nonExecCommands.Add(builder.BuildZ_TestNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// For files that are Excel spreadsheets, access to the workbook API to work with the spreadsheet's contents. Nullable. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "For files that are Excel spreadsheets, access to the workbook API to work with the spreadsheet's contents. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the names property of the microsoft.graph.workbook entity. + /// + /// A + public Command BuildNamesNavCommand() + { + var command = new Command("names"); + command.Description = "Provides operations to manage the names property of the microsoft.graph.workbook entity."; + var builder = new NamesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddFormulaLocalNavCommand()); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the operations property of the microsoft.graph.workbook entity. + /// + /// A + public Command BuildOperationsNavCommand() + { + var command = new Command("operations"); + command.Description = "Provides operations to manage the operations property of the microsoft.graph.workbook entity."; + var builder = new OperationsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property workbook in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property workbook in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.Workbook.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the refreshSession method. + /// + /// A + public Command BuildRefreshSessionNavCommand() + { + var command = new Command("refresh-session"); + command.Description = "Provides operations to call the refreshSession method."; + var builder = new RefreshSessionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the sessionInfoResource method. + /// + /// A + public Command BuildSessionInfoResourceWithKeyRbCommand() + { + var command = new Command("session-info-resource-with-key"); + command.Description = "Provides operations to call the sessionInfoResource method."; + var builder = new SessionInfoResourceWithKeyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the tableRowOperationResult method. + /// + /// A + public Command BuildTableRowOperationResultWithKeyRbCommand() + { + var command = new Command("table-row-operation-result-with-key"); + command.Description = "Provides operations to call the tableRowOperationResult method."; + var builder = new TableRowOperationResultWithKeyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the tables property of the microsoft.graph.workbook entity. + /// + /// A + public Command BuildTablesNavCommand() + { + var command = new Command("tables"); + command.Description = "Provides operations to manage the tables property of the microsoft.graph.workbook entity."; + var builder = new TablesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildItemAtWithIndexRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheets property of the microsoft.graph.workbook entity. + /// + /// A + public Command BuildWorksheetsNavCommand() + { + var command = new Command("worksheets"); + command.Description = "Provides operations to manage the worksheets property of the microsoft.graph.workbook entity."; + var builder = new WorksheetsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property workbook for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// For files that are Excel spreadsheets, access to the workbook API to work with the spreadsheet's contents. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property workbook in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Workbook body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Workbook body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// For files that are Excel spreadsheets, access to the workbook API to work with the spreadsheet's contents. Nullable. + /// + public class WorkbookRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..771b879b08 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Add/AddPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..c75e419baa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Add/AddRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Add a new worksheet to the workbook. The worksheet is added at the end of existing worksheets. If you want to activate the newly added worksheet, call .activate() on it. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Add a new worksheet to the workbook. The worksheet is added at the end of existing worksheets. If you want to activate the newly added worksheet, call .activate() on it.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/worksheetcollection-add?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/add", rawUrl) + { + } + /// + /// Add a new worksheet to the workbook. The worksheet is added at the end of existing worksheets. If you want to activate the newly added worksheet, call .activate() on it. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..12e3f18622 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs new file mode 100644 index 0000000000..a28691f2ff --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/CellWithRowWithColumn/CellWithRowWithColumnRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.CellWithRowWithColumn +{ + /// + /// Provides operations to call the cell method. + /// + public class CellWithRowWithColumnRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object containing the single cell based on row and column numbers. The cell can be outside the bounds of its parent range, so long as it's stays within the worksheet grid. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object containing the single cell based on row and column numbers. The cell can be outside the bounds of its parent range, so long as it's stays within the worksheet grid.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/worksheet-cell?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var rowOption = new Option("--row", description: "Usage: row={row}") { + }; + rowOption.IsRequired = true; + command.AddOption(rowOption); + var columnOption = new Option("--column", description: "Usage: column={column}") { + }; + columnOption.IsRequired = true; + command.AddOption(columnOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var row = invocationContext.ParseResult.GetValueForOption(rowOption); + var column = invocationContext.ParseResult.GetValueForOption(columnOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (row is not null) requestInfo.PathParameters.Add("row", row); + if (column is not null) requestInfo.PathParameters.Add("column", column); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CellWithRowWithColumnRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/cell(row={row},column={column})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CellWithRowWithColumnRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/cell(row={row},column={column})", rawUrl) + { + } + /// + /// Gets the range object containing the single cell based on row and column numbers. The cell can be outside the bounds of its parent range, so long as it's stays within the worksheet grid. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..85a2f521a9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Add/AddPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The seriesBy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesBy { get; set; } +#nullable restore +#else + public string SeriesBy { get; set; } +#endif + /// The sourceData property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SourceData { get; set; } +#nullable restore +#else + public Json SourceData { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "seriesBy", n => { SeriesBy = n.GetStringValue(); } }, + { "sourceData", n => { SourceData = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("seriesBy", SeriesBy); + writer.WriteObjectValue("sourceData", SourceData); + writer.WriteStringValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..7032a8c3dd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Add/AddRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Creates a new chart. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Creates a new chart.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartcollection-add?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/add", rawUrl) + { + } + /// + /// Creates a new chart. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ChartsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ChartsRequestBuilder.cs new file mode 100644 index 0000000000..cbbebefb3c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ChartsRequestBuilder.cs @@ -0,0 +1,457 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts +{ + /// + /// Provides operations to manage the charts property of the microsoft.graph.workbookWorksheet entity. + /// + public class ChartsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the charts property of the microsoft.graph.workbookWorksheet entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookChartItemRequestBuilder(PathParameters); + commands.Add(builder.BuildAxesNavCommand()); + commands.Add(builder.BuildDataLabelsNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildFormatNavCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildImageNavCommand()); + commands.Add(builder.BuildImageWithWidthRbCommand()); + commands.Add(builder.BuildImageWithWidthWithHeightRbCommand()); + commands.Add(builder.BuildImageWithWidthWithHeightWithFittingModeRbCommand()); + commands.Add(builder.BuildLegendNavCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildSeriesNavCommand()); + commands.Add(builder.BuildSetDataNavCommand()); + commands.Add(builder.BuildSetPositionNavCommand()); + commands.Add(builder.BuildTitleNavCommand()); + commands.Add(builder.BuildWorksheetNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to charts for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to charts for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChart.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the itemAt method. + /// + /// A + public Command BuildItemAtWithIndexRbCommand() + { + var command = new Command("item-at-with-index"); + command.Description = "Provides operations to call the itemAt method."; + var builder = new ItemAtWithIndexRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAxesNavCommand()); + nonExecCommands.Add(builder.BuildDataLabelsNavCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildImageNavCommand()); + nonExecCommands.Add(builder.BuildImageWithWidthRbCommand()); + nonExecCommands.Add(builder.BuildImageWithWidthWithHeightRbCommand()); + nonExecCommands.Add(builder.BuildImageWithWidthWithHeightWithFittingModeRbCommand()); + nonExecCommands.Add(builder.BuildLegendNavCommand()); + nonExecCommands.Add(builder.BuildSeriesNavCommand()); + nonExecCommands.Add(builder.BuildSetDataNavCommand()); + nonExecCommands.Add(builder.BuildSetPositionNavCommand()); + nonExecCommands.Add(builder.BuildTitleNavCommand()); + nonExecCommands.Add(builder.BuildWorksheetNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the item method. + /// + /// A + public Command BuildItemWithNameRbCommand() + { + var command = new Command("item-with-name"); + command.Description = "Provides operations to call the item method."; + var builder = new ItemWithNameRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAxesNavCommand()); + nonExecCommands.Add(builder.BuildDataLabelsNavCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildImageNavCommand()); + nonExecCommands.Add(builder.BuildImageWithWidthRbCommand()); + nonExecCommands.Add(builder.BuildImageWithWidthWithHeightRbCommand()); + nonExecCommands.Add(builder.BuildImageWithWidthWithHeightWithFittingModeRbCommand()); + nonExecCommands.Add(builder.BuildLegendNavCommand()); + nonExecCommands.Add(builder.BuildSeriesNavCommand()); + nonExecCommands.Add(builder.BuildSetDataNavCommand()); + nonExecCommands.Add(builder.BuildSetPositionNavCommand()); + nonExecCommands.Add(builder.BuildTitleNavCommand()); + nonExecCommands.Add(builder.BuildWorksheetNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Returns collection of charts that are part of the worksheet. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ChartsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ChartsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Returns collection of charts that are part of the worksheet. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to charts for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookChart body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookChart body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns collection of charts that are part of the worksheet. Read-only. + /// + public class ChartsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Count/CountGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Count/CountGetResponse.cs new file mode 100644 index 0000000000..22e85a0dcc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Count/CountGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Count +{ + #pragma warning disable CS1591 + public class CountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public int? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..fec86a8e48 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Count/CountRequestBuilder.cs @@ -0,0 +1,107 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function count + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/count()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/count()", rawUrl) + { + } + /// + /// Invoke function count + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/AxesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/AxesRequestBuilder.cs new file mode 100644 index 0000000000..1b90b0fd54 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/AxesRequestBuilder.cs @@ -0,0 +1,403 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes +{ + /// + /// Provides operations to manage the axes property of the microsoft.graph.workbookChart entity. + /// + public class AxesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the categoryAxis property of the microsoft.graph.workbookChartAxes entity. + /// + /// A + public Command BuildCategoryAxisNavCommand() + { + var command = new Command("category-axis"); + command.Description = "Provides operations to manage the categoryAxis property of the microsoft.graph.workbookChartAxes entity."; + var builder = new CategoryAxisRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMajorGridlinesNavCommand()); + nonExecCommands.Add(builder.BuildMinorGridlinesNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildTitleNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property axes for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property axes for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart axes. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart axes. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property axes in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property axes in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxes.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the seriesAxis property of the microsoft.graph.workbookChartAxes entity. + /// + /// A + public Command BuildSeriesAxisNavCommand() + { + var command = new Command("series-axis"); + command.Description = "Provides operations to manage the seriesAxis property of the microsoft.graph.workbookChartAxes entity."; + var builder = new SeriesAxisRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMajorGridlinesNavCommand()); + nonExecCommands.Add(builder.BuildMinorGridlinesNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildTitleNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the valueAxis property of the microsoft.graph.workbookChartAxes entity. + /// + /// A + public Command BuildValueAxisNavCommand() + { + var command = new Command("value-axis"); + command.Description = "Provides operations to manage the valueAxis property of the microsoft.graph.workbookChartAxes entity."; + var builder = new ValueAxisRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMajorGridlinesNavCommand()); + nonExecCommands.Add(builder.BuildMinorGridlinesNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildTitleNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AxesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AxesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property axes for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart axes. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property axes in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxes body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxes body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart axes. Read-only. + /// + public class AxesRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs new file mode 100644 index 0000000000..1b82e2c3e3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/CategoryAxisRequestBuilder.cs @@ -0,0 +1,421 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Format; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MajorGridlines; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MinorGridlines; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Title; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis +{ + /// + /// Provides operations to manage the categoryAxis property of the microsoft.graph.workbookChartAxes entity. + /// + public class CategoryAxisRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property categoryAxis for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property categoryAxis for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartAxis entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the category axis in a chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the category axis in a chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the majorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildMajorGridlinesNavCommand() + { + var command = new Command("major-gridlines"); + command.Description = "Provides operations to manage the majorGridlines property of the microsoft.graph.workbookChartAxis entity."; + var builder = new MajorGridlinesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the minorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildMinorGridlinesNavCommand() + { + var command = new Command("minor-gridlines"); + command.Description = "Provides operations to manage the minorGridlines property of the microsoft.graph.workbookChartAxis entity."; + var builder = new MinorGridlinesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property categoryAxis in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property categoryAxis in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxis.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildTitleNavCommand() + { + var command = new Command("title"); + command.Description = "Provides operations to manage the title property of the microsoft.graph.workbookChartAxis entity."; + var builder = new TitleRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CategoryAxisRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CategoryAxisRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property categoryAxis for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the category axis in a chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property categoryAxis in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxis body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxis body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the category axis in a chart. Read-only. + /// + public class CategoryAxisRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..5f6ee296de --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..94ecb31db5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/FormatRequestBuilder.cs @@ -0,0 +1,362 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Format.Font; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxis entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartAxisFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartAxisFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartAxisFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxisFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..3066a346c3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..67e69ec100 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartAxisFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..b3ced5e331 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MajorGridlines.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MajorGridlines.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of chart gridlines. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlinesFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/majorGridlines/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/majorGridlines/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..6ec0ef14d4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MajorGridlines.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/majorGridlines/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/majorGridlines/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..85e8dc27e1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MajorGridlines.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MajorGridlines.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/majorGridlines/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/majorGridlines/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs new file mode 100644 index 0000000000..792c73635d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MajorGridlines.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MajorGridlines +{ + /// + /// Provides operations to manage the majorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + public class MajorGridlinesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property majorGridlines for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property majorGridlines for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property majorGridlines in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property majorGridlines in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlines.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MajorGridlinesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/majorGridlines{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MajorGridlinesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/majorGridlines{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property majorGridlines for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property majorGridlines in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// + public class MajorGridlinesRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..de75939ec2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MinorGridlines.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MinorGridlines.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of chart gridlines. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlinesFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/minorGridlines/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/minorGridlines/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..aef158f725 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MinorGridlines.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/minorGridlines/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/minorGridlines/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..18095bba7c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MinorGridlines.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MinorGridlines.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/minorGridlines/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/minorGridlines/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs new file mode 100644 index 0000000000..701c79e5a8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MinorGridlines.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.MinorGridlines +{ + /// + /// Provides operations to manage the minorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + public class MinorGridlinesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property minorGridlines for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property minorGridlines for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property minorGridlines in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property minorGridlines in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlines.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MinorGridlinesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/minorGridlines{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MinorGridlinesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/minorGridlines{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property minorGridlines for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property minorGridlines in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// + public class MinorGridlinesRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..91995d570a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Title.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisTitleFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/title/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/title/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..0d0e71ee95 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/Format/FormatRequestBuilder.cs @@ -0,0 +1,336 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Title.Format.Font; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Title.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxisTitle entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisTitleFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartAxisTitleFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the formatting of chart axis title. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of chart axis title. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxisTitleFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/title/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/title/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart axis title. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitleFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitleFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart axis title. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs new file mode 100644 index 0000000000..b5d9d47573 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/CategoryAxis/Title/TitleRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Title.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.CategoryAxis.Title +{ + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChartAxis entity. + /// + public class TitleRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property title for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property title for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxisTitle entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartAxisTitle entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the axis title. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the axis title. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property title in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property title in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxisTitle.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TitleRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/title{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TitleRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/categoryAxis/title{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property title for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the axis title. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property title in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitle body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitle body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the axis title. Read-only. + /// + public class TitleRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..34429ee88e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..5247de15d7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/FormatRequestBuilder.cs @@ -0,0 +1,362 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Format.Font; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxis entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartAxisFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartAxisFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartAxisFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxisFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..0cc71b2edd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..4e4b027249 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartAxisFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..1bf2be670a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MajorGridlines.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MajorGridlines.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of chart gridlines. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlinesFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/majorGridlines/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/majorGridlines/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..8b88fc4955 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MajorGridlines.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/majorGridlines/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/majorGridlines/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..7b971bd1cc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MajorGridlines.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MajorGridlines.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/majorGridlines/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/majorGridlines/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs new file mode 100644 index 0000000000..0f53a7fca5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MajorGridlines.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MajorGridlines +{ + /// + /// Provides operations to manage the majorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + public class MajorGridlinesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property majorGridlines for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property majorGridlines for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property majorGridlines in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property majorGridlines in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlines.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MajorGridlinesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/majorGridlines{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MajorGridlinesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/majorGridlines{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property majorGridlines for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property majorGridlines in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// + public class MajorGridlinesRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..b3ffbbf107 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MinorGridlines.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MinorGridlines.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of chart gridlines. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlinesFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/minorGridlines/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/minorGridlines/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..24a3013566 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MinorGridlines.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/minorGridlines/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/minorGridlines/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..89167c8a25 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MinorGridlines.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MinorGridlines.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/minorGridlines/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/minorGridlines/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs new file mode 100644 index 0000000000..23bb1ec37e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MinorGridlines.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MinorGridlines +{ + /// + /// Provides operations to manage the minorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + public class MinorGridlinesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property minorGridlines for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property minorGridlines for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property minorGridlines in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property minorGridlines in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlines.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MinorGridlinesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/minorGridlines{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MinorGridlinesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/minorGridlines{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property minorGridlines for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property minorGridlines in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// + public class MinorGridlinesRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs new file mode 100644 index 0000000000..d66b92a10f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/SeriesAxisRequestBuilder.cs @@ -0,0 +1,421 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Format; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MajorGridlines; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.MinorGridlines; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Title; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis +{ + /// + /// Provides operations to manage the seriesAxis property of the microsoft.graph.workbookChartAxes entity. + /// + public class SeriesAxisRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property seriesAxis for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property seriesAxis for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartAxis entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the series axis of a 3-dimensional chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the series axis of a 3-dimensional chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the majorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildMajorGridlinesNavCommand() + { + var command = new Command("major-gridlines"); + command.Description = "Provides operations to manage the majorGridlines property of the microsoft.graph.workbookChartAxis entity."; + var builder = new MajorGridlinesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the minorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildMinorGridlinesNavCommand() + { + var command = new Command("minor-gridlines"); + command.Description = "Provides operations to manage the minorGridlines property of the microsoft.graph.workbookChartAxis entity."; + var builder = new MinorGridlinesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property seriesAxis in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property seriesAxis in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxis.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildTitleNavCommand() + { + var command = new Command("title"); + command.Description = "Provides operations to manage the title property of the microsoft.graph.workbookChartAxis entity."; + var builder = new TitleRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SeriesAxisRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SeriesAxisRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property seriesAxis for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the series axis of a 3-dimensional chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property seriesAxis in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxis body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxis body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the series axis of a 3-dimensional chart. Read-only. + /// + public class SeriesAxisRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..b8f811eeb6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Title.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisTitleFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/title/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/title/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..76d9f390aa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/Format/FormatRequestBuilder.cs @@ -0,0 +1,336 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Title.Format.Font; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Title.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxisTitle entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisTitleFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartAxisTitleFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the formatting of chart axis title. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of chart axis title. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxisTitleFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/title/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/title/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart axis title. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitleFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitleFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart axis title. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs new file mode 100644 index 0000000000..dff2d9ed87 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/SeriesAxis/Title/TitleRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Title.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.SeriesAxis.Title +{ + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChartAxis entity. + /// + public class TitleRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property title for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property title for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxisTitle entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartAxisTitle entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the axis title. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the axis title. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property title in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property title in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxisTitle.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TitleRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/title{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TitleRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/seriesAxis/title{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property title for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the axis title. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property title in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitle body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitle body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the axis title. Read-only. + /// + public class TitleRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..b412c2ceae --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart axis element. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..c91167dfe8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/FormatRequestBuilder.cs @@ -0,0 +1,362 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Format.Font; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxis entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartAxisFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of a chart object, which includes line and font formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartAxisFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartAxisFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxisFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart object, which includes line and font formatting. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..dccb99a21f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..fd3f9cccc7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartAxisFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..48e65137e5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/FormatRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MajorGridlines.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MajorGridlines.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of chart gridlines. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlinesFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/majorGridlines/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/majorGridlines/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..cc2d5c225d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MajorGridlines.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/majorGridlines/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/majorGridlines/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..a07b35f885 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MajorGridlines.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MajorGridlines.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/majorGridlines/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/majorGridlines/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs new file mode 100644 index 0000000000..dca92d48a0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MajorGridlines/MajorGridlinesRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MajorGridlines.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MajorGridlines +{ + /// + /// Provides operations to manage the majorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + public class MajorGridlinesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property majorGridlines for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property majorGridlines for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns a gridlines object that represents the major gridlines for the specified axis. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property majorGridlines in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property majorGridlines in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlines.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MajorGridlinesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/majorGridlines{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MajorGridlinesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/majorGridlines{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property majorGridlines for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property majorGridlines in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a gridlines object that represents the major gridlines for the specified axis. Read-only. + /// + public class MajorGridlinesRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..04e3419e60 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/FormatRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MinorGridlines.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MinorGridlines.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of chart gridlines. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlinesFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/minorGridlines/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/minorGridlines/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlinesFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart gridlines. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..640787ad1b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MinorGridlines.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/minorGridlines/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/minorGridlines/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..c8de76e616 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MinorGridlines.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MinorGridlines.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartGridlinesFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/minorGridlines/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/minorGridlines/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs new file mode 100644 index 0000000000..f6073f3422 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/MinorGridlines/MinorGridlinesRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MinorGridlines.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MinorGridlines +{ + /// + /// Provides operations to manage the minorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + public class MinorGridlinesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property minorGridlines for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property minorGridlines for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartGridlines entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property minorGridlines in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property minorGridlines in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartGridlines.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MinorGridlinesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/minorGridlines{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MinorGridlinesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/minorGridlines{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property minorGridlines for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property minorGridlines in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartGridlines body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a Gridlines object that represents the minor gridlines for the specified axis. Read-only. + /// + public class MinorGridlinesRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..313379446d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Title.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisTitleFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/title/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/title/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes, such as font name, font size, color, etc. of chart axis title object. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..576d2fc05b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/Format/FormatRequestBuilder.cs @@ -0,0 +1,336 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Title.Format.Font; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Title.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxisTitle entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAxisTitleFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartAxisTitleFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the formatting of chart axis title. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of chart axis title. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxisTitleFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/title/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/title/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart axis title. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitleFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitleFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of chart axis title. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs new file mode 100644 index 0000000000..e99cb24a17 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/Title/TitleRequestBuilder.cs @@ -0,0 +1,342 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Title.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Title +{ + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChartAxis entity. + /// + public class TitleRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property title for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property title for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxisTitle entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartAxisTitle entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the axis title. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the axis title. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property title in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property title in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxisTitle.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TitleRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/title{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TitleRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis/title{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property title for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the axis title. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property title in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitle body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxisTitle body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the axis title. Read-only. + /// + public class TitleRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs new file mode 100644 index 0000000000..d6d49a6b23 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Axes/ValueAxis/ValueAxisRequestBuilder.cs @@ -0,0 +1,421 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Format; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MajorGridlines; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.MinorGridlines; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis.Title; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes.ValueAxis +{ + /// + /// Provides operations to manage the valueAxis property of the microsoft.graph.workbookChartAxes entity. + /// + public class ValueAxisRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property valueAxis for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property valueAxis for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartAxis entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the value axis in an axis. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the value axis in an axis. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the majorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildMajorGridlinesNavCommand() + { + var command = new Command("major-gridlines"); + command.Description = "Provides operations to manage the majorGridlines property of the microsoft.graph.workbookChartAxis entity."; + var builder = new MajorGridlinesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the minorGridlines property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildMinorGridlinesNavCommand() + { + var command = new Command("minor-gridlines"); + command.Description = "Provides operations to manage the minorGridlines property of the microsoft.graph.workbookChartAxis entity."; + var builder = new MinorGridlinesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property valueAxis in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property valueAxis in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxis.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChartAxis entity. + /// + /// A + public Command BuildTitleNavCommand() + { + var command = new Command("title"); + command.Description = "Provides operations to manage the title property of the microsoft.graph.workbookChartAxis entity."; + var builder = new TitleRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ValueAxisRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ValueAxisRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/axes/valueAxis{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property valueAxis for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the value axis in an axis. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property valueAxis in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxis body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxis body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the value axis in an axis. Read-only. + /// + public class ValueAxisRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs new file mode 100644 index 0000000000..581330c245 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/DataLabelsRequestBuilder.cs @@ -0,0 +1,343 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels +{ + /// + /// Provides operations to manage the dataLabels property of the microsoft.graph.workbookChart entity. + /// + public class DataLabelsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property dataLabels for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property dataLabels for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartDataLabels entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartDataLabels entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFillNavCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the data labels on the chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the data labels on the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property dataLabels in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property dataLabels in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartDataLabels.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataLabelsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataLabelsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property dataLabels for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the data labels on the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property dataLabels in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartDataLabels body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartDataLabels body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the data labels on the chart. Read-only. + /// + public class DataLabelsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..9d54c913a7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format.Fill.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the fill color of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the fill color of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format/fill/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format/fill/clear", rawUrl) + { + } + /// + /// Clear the fill color of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs new file mode 100644 index 0000000000..85c792a869 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/FillRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format.Fill.Clear; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format.Fill.SetSolidColor; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format.Fill +{ + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartDataLabelFormat entity. + /// + public class FillRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property fill for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fill for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the fill format of the current chart data label. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the fill format of the current chart data label. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fill in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fill in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFill.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the setSolidColor method. + /// + /// A + public Command BuildSetSolidColorNavCommand() + { + var command = new Command("set-solid-color"); + command.Description = "Provides operations to call the setSolidColor method."; + var builder = new SetSolidColorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FillRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format/fill{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FillRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format/fill{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fill for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of the current chart data label. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fill in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of the current chart data label. Read-only. + /// + public class FillRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs new file mode 100644 index 0000000000..c046dcacc7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format.Fill.SetSolidColor +{ + #pragma warning disable CS1591 + public class SetSolidColorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetSolidColorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetSolidColorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetSolidColorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs new file mode 100644 index 0000000000..96b1fe2019 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format.Fill.SetSolidColor +{ + /// + /// Provides operations to call the setSolidColor method. + /// + public class SetSolidColorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Sets the fill formatting of a chart element to a uniform color.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-setsolidcolor?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetSolidColorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetSolidColorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format/fill/setSolidColor", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetSolidColorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format/fill/setSolidColor", rawUrl) + { + } + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..553f0ba024 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartDataLabelFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for a chart data label. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..369fa4f850 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/DataLabels/Format/FormatRequestBuilder.cs @@ -0,0 +1,363 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format.Fill; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format.Font; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartDataLabels entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartDataLabelFormat entity. + /// + /// A + public Command BuildFillNavCommand() + { + var command = new Command("fill"); + command.Description = "Provides operations to manage the fill property of the microsoft.graph.workbookChartDataLabelFormat entity."; + var builder = new FillRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildSetSolidColorNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartDataLabelFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartDataLabelFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the format of chart data labels, which includes fill and font formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the format of chart data labels, which includes fill and font formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartDataLabelFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/dataLabels/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the format of chart data labels, which includes fill and font formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartDataLabelFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartDataLabelFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the format of chart data labels, which includes fill and font formatting. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..bc81c3fe02 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format.Fill.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the fill color of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the fill color of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format/fill/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format/fill/clear", rawUrl) + { + } + /// + /// Clear the fill color of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/FillRequestBuilder.cs new file mode 100644 index 0000000000..6db6dc483e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/FillRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format.Fill.Clear; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format.Fill.SetSolidColor; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format.Fill +{ + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartAreaFormat entity. + /// + public class FillRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property fill for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fill for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the fill format of an object, which includes background formatting information. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fill in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fill in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFill.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the setSolidColor method. + /// + /// A + public Command BuildSetSolidColorNavCommand() + { + var command = new Command("set-solid-color"); + command.Description = "Provides operations to call the setSolidColor method."; + var builder = new SetSolidColorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FillRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format/fill{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FillRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format/fill{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fill for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of an object, which includes background formatting information. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fill in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of an object, which includes background formatting information. Read-only. + /// + public class FillRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs new file mode 100644 index 0000000000..096692a2bd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format.Fill.SetSolidColor +{ + #pragma warning disable CS1591 + public class SetSolidColorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetSolidColorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetSolidColorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetSolidColorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs new file mode 100644 index 0000000000..c50872baae --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format.Fill.SetSolidColor +{ + /// + /// Provides operations to call the setSolidColor method. + /// + public class SetSolidColorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Sets the fill formatting of a chart element to a uniform color.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-setsolidcolor?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetSolidColorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetSolidColorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format/fill/setSolidColor", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetSolidColorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format/fill/setSolidColor", rawUrl) + { + } + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..a2c7b17df1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAreaFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..5cc22c3c18 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Format/FormatRequestBuilder.cs @@ -0,0 +1,363 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format.Fill; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format.Font; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChart entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartAreaFormat entity. + /// + /// A + public Command BuildFillNavCommand() + { + var command = new Command("fill"); + command.Description = "Provides operations to manage the fill property of the microsoft.graph.workbookChartAreaFormat entity."; + var builder = new FillRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildSetSolidColorNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartAreaFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartAreaFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Encapsulates the format properties for the chart area. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Encapsulates the format properties for the chart area. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAreaFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties for the chart area. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAreaFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAreaFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties for the chart area. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageGetResponse.cs new file mode 100644 index 0000000000..9a54924947 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Image +{ + #pragma warning disable CS1591 + public class ImageGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageRequestBuilder.cs new file mode 100644 index 0000000000..f0aa6779de --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Image/ImageRequestBuilder.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Image +{ + /// + /// Provides operations to call the image method. + /// + public class ImageRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/image()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/image()", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthGetResponse.cs new file mode 100644 index 0000000000..1015e256a1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.ImageWithWidth +{ + #pragma warning disable CS1591 + public class ImageWithWidthGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageWithWidthGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageWithWidthGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageWithWidthGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs new file mode 100644 index 0000000000..0c80b64d95 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidth/ImageWithWidthRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.ImageWithWidth +{ + /// + /// Provides operations to call the image method. + /// + public class ImageWithWidthRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}") { + }; + widthOption.IsRequired = true; + command.AddOption(widthOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var width = invocationContext.ParseResult.GetValueForOption(widthOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (width is not null) requestInfo.PathParameters.Add("width", width); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageWithWidthRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/image(width={width})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageWithWidthRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/image(width={width})", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightGetResponse.cs new file mode 100644 index 0000000000..553631779a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.ImageWithWidthWithHeight +{ + #pragma warning disable CS1591 + public class ImageWithWidthWithHeightGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageWithWidthWithHeightGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageWithWidthWithHeightGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageWithWidthWithHeightGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs new file mode 100644 index 0000000000..69dc2e26b1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.ImageWithWidthWithHeight +{ + /// + /// Provides operations to call the image method. + /// + public class ImageWithWidthWithHeightRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}") { + }; + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}") { + }; + heightOption.IsRequired = true; + command.AddOption(heightOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var width = invocationContext.ParseResult.GetValueForOption(widthOption); + var height = invocationContext.ParseResult.GetValueForOption(heightOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (width is not null) requestInfo.PathParameters.Add("width", width); + if (height is not null) requestInfo.PathParameters.Add("height", height); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageWithWidthWithHeightRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/image(width={width},height={height})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageWithWidthWithHeightRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/image(width={width},height={height})", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeGetResponse.cs new file mode 100644 index 0000000000..da07ede70b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.ImageWithWidthWithHeightWithFittingMode +{ + #pragma warning disable CS1591 + public class ImageWithWidthWithHeightWithFittingModeGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageWithWidthWithHeightWithFittingModeGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageWithWidthWithHeightWithFittingModeGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageWithWidthWithHeightWithFittingModeGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs new file mode 100644 index 0000000000..07bcce231a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.ImageWithWidthWithHeightWithFittingMode +{ + /// + /// Provides operations to call the image method. + /// + public class ImageWithWidthWithHeightWithFittingModeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var widthOption = new Option("--width", description: "Usage: width={width}") { + }; + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}") { + }; + heightOption.IsRequired = true; + command.AddOption(heightOption); + var fittingModeOption = new Option("--fitting-mode", description: "Usage: fittingMode='{fittingMode}'") { + }; + fittingModeOption.IsRequired = true; + command.AddOption(fittingModeOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var width = invocationContext.ParseResult.GetValueForOption(widthOption); + var height = invocationContext.ParseResult.GetValueForOption(heightOption); + var fittingMode = invocationContext.ParseResult.GetValueForOption(fittingModeOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (width is not null) requestInfo.PathParameters.Add("width", width); + if (height is not null) requestInfo.PathParameters.Add("height", height); + if (fittingMode is not null) requestInfo.PathParameters.Add("fittingMode", fittingMode); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageWithWidthWithHeightWithFittingModeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/image(width={width},height={height},fittingMode='{fittingMode}')", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageWithWidthWithHeightWithFittingModeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/image(width={width},height={height},fittingMode='{fittingMode}')", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..689c33291e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format.Fill.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the fill color of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the fill color of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format/fill/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format/fill/clear", rawUrl) + { + } + /// + /// Clear the fill color of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs new file mode 100644 index 0000000000..53767a47a5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/FillRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format.Fill.Clear; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format.Fill.SetSolidColor; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format.Fill +{ + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartLegendFormat entity. + /// + public class FillRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property fill for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fill for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the fill format of an object, which includes background formating information. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the fill format of an object, which includes background formating information. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fill in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fill in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFill.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the setSolidColor method. + /// + /// A + public Command BuildSetSolidColorNavCommand() + { + var command = new Command("set-solid-color"); + command.Description = "Provides operations to call the setSolidColor method."; + var builder = new SetSolidColorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FillRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format/fill{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FillRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format/fill{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fill for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of an object, which includes background formating information. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fill in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of an object, which includes background formating information. Read-only. + /// + public class FillRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs new file mode 100644 index 0000000000..641e90b07f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format.Fill.SetSolidColor +{ + #pragma warning disable CS1591 + public class SetSolidColorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetSolidColorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetSolidColorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetSolidColorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs new file mode 100644 index 0000000000..81be040110 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format.Fill.SetSolidColor +{ + /// + /// Provides operations to call the setSolidColor method. + /// + public class SetSolidColorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Sets the fill formatting of a chart element to a uniform color.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-setsolidcolor?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetSolidColorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetSolidColorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format/fill/setSolidColor", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetSolidColorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format/fill/setSolidColor", rawUrl) + { + } + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..e063ce849b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartLegendFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes such as font name, font size, color, etc. of a chart legend. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..7e05d650d4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/Format/FormatRequestBuilder.cs @@ -0,0 +1,363 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format.Fill; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format.Font; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartLegend entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartLegendFormat entity. + /// + /// A + public Command BuildFillNavCommand() + { + var command = new Command("fill"); + command.Description = "Provides operations to manage the fill property of the microsoft.graph.workbookChartLegendFormat entity."; + var builder = new FillRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildSetSolidColorNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartLegendFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartLegendFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the formatting of a chart legend, which includes fill and font formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of a chart legend, which includes fill and font formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLegendFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart legend, which includes fill and font formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLegendFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLegendFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart legend, which includes fill and font formatting. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/LegendRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/LegendRequestBuilder.cs new file mode 100644 index 0000000000..ec4cfc928e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Legend/LegendRequestBuilder.cs @@ -0,0 +1,343 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend +{ + /// + /// Provides operations to manage the legend property of the microsoft.graph.workbookChart entity. + /// + public class LegendRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property legend for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property legend for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartLegend entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartLegend entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFillNavCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the legend for the chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the legend for the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property legend in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property legend in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLegend.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LegendRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LegendRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/legend{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property legend for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the legend for the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property legend in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLegend body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLegend body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the legend for the chart. Read-only. + /// + public class LegendRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountGetResponse.cs new file mode 100644 index 0000000000..67a81c6d3c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Count +{ + #pragma warning disable CS1591 + public class CountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public int? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..e4412d04c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Count/CountRequestBuilder.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function count + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/count()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/count()", rawUrl) + { + } + /// + /// Invoke function count + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..c5ffb61db4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -0,0 +1,110 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Fill.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the fill color of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the fill color of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/fill/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/fill/clear", rawUrl) + { + } + /// + /// Clear the fill color of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs new file mode 100644 index 0000000000..edda6c78cf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/FillRequestBuilder.cs @@ -0,0 +1,370 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Fill.Clear; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Fill.SetSolidColor; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Fill +{ + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartSeriesFormat entity. + /// + public class FillRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property fill for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fill for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the fill format of a chart series, which includes background formatting information. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the fill format of a chart series, which includes background formatting information. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fill in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fill in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFill.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the setSolidColor method. + /// + /// A + public Command BuildSetSolidColorNavCommand() + { + var command = new Command("set-solid-color"); + command.Description = "Provides operations to call the setSolidColor method."; + var builder = new SetSolidColorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FillRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/fill{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FillRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/fill{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fill for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of a chart series, which includes background formatting information. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fill in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of a chart series, which includes background formatting information. Read-only. + /// + public class FillRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs new file mode 100644 index 0000000000..4803e6afd5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Fill.SetSolidColor +{ + #pragma warning disable CS1591 + public class SetSolidColorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetSolidColorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetSolidColorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetSolidColorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs new file mode 100644 index 0000000000..c89ea45405 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Fill.SetSolidColor +{ + /// + /// Provides operations to call the setSolidColor method. + /// + public class SetSolidColorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Sets the fill formatting of a chart element to a uniform color.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-setsolidcolor?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetSolidColorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetSolidColorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/fill/setSolidColor", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetSolidColorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/fill/setSolidColor", rawUrl) + { + } + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..76f8cb2749 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/FormatRequestBuilder.cs @@ -0,0 +1,387 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Fill; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Line; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartSeries entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartSeriesFormat entity. + /// + /// A + public Command BuildFillNavCommand() + { + var command = new Command("fill"); + command.Description = "Provides operations to manage the fill property of the microsoft.graph.workbookChartSeriesFormat entity."; + var builder = new FillRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildSetSolidColorNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the formatting of a chart series, which includes fill and line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartSeriesFormat entity. + /// + /// A + public Command BuildLineNavCommand() + { + var command = new Command("line"); + command.Description = "Provides operations to manage the line property of the microsoft.graph.workbookChartSeriesFormat entity."; + var builder = new LineRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartSeriesFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart series, which includes fill and line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartSeriesFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartSeriesFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart series, which includes fill and line formatting. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..ae7a4a4ce9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/Clear/ClearRequestBuilder.cs @@ -0,0 +1,110 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Line.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the line format of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the line format of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartlineformat-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/line/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/line/clear", rawUrl) + { + } + /// + /// Clear the line format of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs new file mode 100644 index 0000000000..6008202178 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Format/Line/LineRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Line.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format.Line +{ + /// + /// Provides operations to manage the line property of the microsoft.graph.workbookChartSeriesFormat entity. + /// + public class LineRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property line for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property line for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property line in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property line in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLineFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LineRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/line{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LineRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/format/line{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property line for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property line in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLineFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents line formatting. Read-only. + /// + public class LineRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountGetResponse.cs new file mode 100644 index 0000000000..c9655e5313 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Count +{ + #pragma warning disable CS1591 + public class CountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public int? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..cfb344eddc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Count/CountRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function count + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/count()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/count()", rawUrl) + { + } + /// + /// Invoke function count + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..885a656164 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/Clear/ClearRequestBuilder.cs @@ -0,0 +1,116 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item.Format.Fill.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the fill color of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the fill color of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}/format/fill/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}/format/fill/clear", rawUrl) + { + } + /// + /// Clear the fill color of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs new file mode 100644 index 0000000000..8399a2486b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/FillRequestBuilder.cs @@ -0,0 +1,388 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item.Format.Fill.Clear; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item.Format.Fill.SetSolidColor; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item.Format.Fill +{ + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartPointFormat entity. + /// + public class FillRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property fill for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fill for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the fill format of a chart, which includes background formatting information. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the fill format of a chart, which includes background formatting information. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fill in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fill in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFill.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the setSolidColor method. + /// + /// A + public Command BuildSetSolidColorNavCommand() + { + var command = new Command("set-solid-color"); + command.Description = "Provides operations to call the setSolidColor method."; + var builder = new SetSolidColorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FillRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}/format/fill{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FillRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}/format/fill{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fill for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of a chart, which includes background formatting information. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fill in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of a chart, which includes background formatting information. Read-only. + /// + public class FillRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs new file mode 100644 index 0000000000..5ed4807c72 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item.Format.Fill.SetSolidColor +{ + #pragma warning disable CS1591 + public class SetSolidColorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetSolidColorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetSolidColorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetSolidColorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs new file mode 100644 index 0000000000..f2eed3596d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item.Format.Fill.SetSolidColor +{ + /// + /// Provides operations to call the setSolidColor method. + /// + public class SetSolidColorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Sets the fill formatting of a chart element to a uniform color.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-setsolidcolor?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetSolidColorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetSolidColorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}/format/fill/setSolidColor", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetSolidColorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}/format/fill/setSolidColor", rawUrl) + { + } + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..136f793d7f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/Format/FormatRequestBuilder.cs @@ -0,0 +1,379 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item.Format.Fill; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartPoint entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartPointFormat entity. + /// + /// A + public Command BuildFillNavCommand() + { + var command = new Command("fill"); + command.Description = "Provides operations to manage the fill property of the microsoft.graph.workbookChartPointFormat entity."; + var builder = new FillRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildSetSolidColorNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Encapsulates the format properties chart point. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Encapsulates the format properties chart point. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartPointFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties chart point. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartPointFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartPointFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties chart point. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/WorkbookChartPointItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/WorkbookChartPointItemRequestBuilder.cs new file mode 100644 index 0000000000..6bdc456c47 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/Item/WorkbookChartPointItemRequestBuilder.cs @@ -0,0 +1,378 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item +{ + /// + /// Provides operations to manage the points property of the microsoft.graph.workbookChartSeries entity. + /// + public class WorkbookChartPointItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property points for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property points for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartPoint entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartPoint entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFillNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents a collection of all points in the series. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all points in the series. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property points in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property points in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var workbookChartPointIdOption = new Option("--workbook-chart-point-id", description: "The unique identifier of workbookChartPoint") { + }; + workbookChartPointIdOption.IsRequired = true; + command.AddOption(workbookChartPointIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var workbookChartPointId = invocationContext.ParseResult.GetValueForOption(workbookChartPointIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartPoint.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (workbookChartPointId is not null) requestInfo.PathParameters.Add("workbookChartPoint%2Did", workbookChartPointId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookChartPointItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookChartPointItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/{workbookChartPoint%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property points for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all points in the series. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property points in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartPoint body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartPoint body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all points in the series. Read-only. + /// + public class WorkbookChartPointItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..d864926c76 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/Format/FormatRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.ItemAtWithIndex.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartPoint entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Encapsulates the format properties chart point. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Encapsulates the format properties chart point. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartPointFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/itemAt(index={index})/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/itemAt(index={index})/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties chart point. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartPointFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartPointFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties chart point. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs new file mode 100644 index 0000000000..63691bf425 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -0,0 +1,147 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.ItemAtWithIndex.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.ItemAtWithIndex +{ + /// + /// Provides operations to call the itemAt method. + /// + public class ItemAtWithIndexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartPoint entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartPoint entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Retrieve a point based on its position within the series. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Retrieve a point based on its position within the series.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartpointscollection-itemat?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemAtWithIndexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/itemAt(index={index})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemAtWithIndexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points/itemAt(index={index})", rawUrl) + { + } + /// + /// Retrieve a point based on its position within the series. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs new file mode 100644 index 0000000000..d8ccc2ba2c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/Points/PointsRequestBuilder.cs @@ -0,0 +1,403 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points.ItemAtWithIndex; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points +{ + /// + /// Provides operations to manage the points property of the microsoft.graph.workbookChartSeries entity. + /// + public class PointsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the points property of the microsoft.graph.workbookChartSeries entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookChartPointItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildFormatNavCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, commands); + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to points for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to points for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartPoint.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the itemAt method. + /// + /// A + public Command BuildItemAtWithIndexRbCommand() + { + var command = new Command("item-at-with-index"); + command.Description = "Provides operations to call the itemAt method."; + var builder = new ItemAtWithIndexRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents a collection of all points in the series. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents a collection of all points in the series. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PointsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PointsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}/points{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all points in the series. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to points for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookChartPoint body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookChartPoint body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all points in the series. Read-only. + /// + public class PointsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/WorkbookChartSeriesItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/WorkbookChartSeriesItemRequestBuilder.cs new file mode 100644 index 0000000000..d2ab0d6562 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/Item/WorkbookChartSeriesItemRequestBuilder.cs @@ -0,0 +1,390 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Format; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item.Points; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item +{ + /// + /// Provides operations to manage the series property of the microsoft.graph.workbookChart entity. + /// + public class WorkbookChartSeriesItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property series for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property series for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartSeries entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartSeries entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFillNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildLineNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents either a single series or collection of series in the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property series in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property series in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var workbookChartSeriesIdOption = new Option("--workbook-chart-series-id", description: "The unique identifier of workbookChartSeries") { + }; + workbookChartSeriesIdOption.IsRequired = true; + command.AddOption(workbookChartSeriesIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var workbookChartSeriesId = invocationContext.ParseResult.GetValueForOption(workbookChartSeriesIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartSeries.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (workbookChartSeriesId is not null) requestInfo.PathParameters.Add("workbookChartSeries%2Did", workbookChartSeriesId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the points property of the microsoft.graph.workbookChartSeries entity. + /// + /// A + public Command BuildPointsNavCommand() + { + var command = new Command("points"); + command.Description = "Provides operations to manage the points property of the microsoft.graph.workbookChartSeries entity."; + var builder = new PointsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildItemAtWithIndexRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookChartSeriesItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookChartSeriesItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/{workbookChartSeries%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property series for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property series in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartSeries body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartSeries body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + public class WorkbookChartSeriesItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..cc09089aa0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/Format/FormatRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.ItemAtWithIndex.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartSeries entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the formatting of a chart series, which includes fill and line formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of a chart series, which includes fill and line formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartSeriesFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/itemAt(index={index})/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/itemAt(index={index})/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart series, which includes fill and line formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartSeriesFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartSeriesFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart series, which includes fill and line formatting. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs new file mode 100644 index 0000000000..de96641506 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -0,0 +1,160 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.ItemAtWithIndex.Format; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.ItemAtWithIndex.Points; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.ItemAtWithIndex +{ + /// + /// Provides operations to call the itemAt method. + /// + public class ItemAtWithIndexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartSeries entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartSeries entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Retrieves a series based on its position in the collection + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Retrieves a series based on its position in the collection\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartseriescollection-itemat?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the points property of the microsoft.graph.workbookChartSeries entity. + /// + /// A + public Command BuildPointsNavCommand() + { + var command = new Command("points"); + command.Description = "Provides operations to manage the points property of the microsoft.graph.workbookChartSeries entity."; + var builder = new PointsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemAtWithIndexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/itemAt(index={index})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemAtWithIndexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/itemAt(index={index})", rawUrl) + { + } + /// + /// Retrieves a series based on its position in the collection + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/Points/PointsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/Points/PointsRequestBuilder.cs new file mode 100644 index 0000000000..c1c8a59370 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/ItemAtWithIndex/Points/PointsRequestBuilder.cs @@ -0,0 +1,345 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.ItemAtWithIndex.Points +{ + /// + /// Provides operations to manage the points property of the microsoft.graph.workbookChartSeries entity. + /// + public class PointsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Represents a collection of all points in the series. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all points in the series. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Create new navigation property to points for storage + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Create new navigation property to points for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartPoint.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PointsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/itemAt(index={index})/points{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PointsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series/itemAt(index={index})/points{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all points in the series. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to points for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookChartPoint body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookChartPoint body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all points in the series. Read-only. + /// + public class PointsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/SeriesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/SeriesRequestBuilder.cs new file mode 100644 index 0000000000..a53011c321 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Series/SeriesRequestBuilder.cs @@ -0,0 +1,393 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series.ItemAtWithIndex; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series +{ + /// + /// Provides operations to manage the series property of the microsoft.graph.workbookChart entity. + /// + public class SeriesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the series property of the microsoft.graph.workbookChart entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookChartSeriesItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildFormatNavCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildPointsNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to series for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to series for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartSeries.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the itemAt method. + /// + /// A + public Command BuildItemAtWithIndexRbCommand() + { + var command = new Command("item-at-with-index"); + command.Description = "Provides operations to call the itemAt method."; + var builder = new ItemAtWithIndexRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildPointsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents either a single series or collection of series in the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SeriesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SeriesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/series{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to series for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookChartSeries body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookChartSeries body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + public class SeriesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataPostRequestBody.cs new file mode 100644 index 0000000000..d6ddb088c1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.SetData +{ + #pragma warning disable CS1591 + public class SetDataPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The seriesBy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesBy { get; set; } +#nullable restore +#else + public string SeriesBy { get; set; } +#endif + /// The sourceData property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SourceData { get; set; } +#nullable restore +#else + public Json SourceData { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetDataPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetDataPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetDataPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "seriesBy", n => { SeriesBy = n.GetStringValue(); } }, + { "sourceData", n => { SourceData = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("seriesBy", SeriesBy); + writer.WriteObjectValue("sourceData", SourceData); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataRequestBuilder.cs new file mode 100644 index 0000000000..8e81ea19c9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetData/SetDataRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.SetData +{ + /// + /// Provides operations to call the setData method. + /// + public class SetDataRequestBuilder : BaseCliRequestBuilder + { + /// + /// Resets the source data for the chart. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Resets the source data for the chart.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chart-setdata?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetDataPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetDataRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/setData", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetDataRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/setData", rawUrl) + { + } + /// + /// Resets the source data for the chart. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetDataPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetDataPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionPostRequestBody.cs new file mode 100644 index 0000000000..e8f9c3311a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.SetPosition +{ + #pragma warning disable CS1591 + public class SetPositionPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endCell property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndCell { get; set; } +#nullable restore +#else + public Json EndCell { get; set; } +#endif + /// The startCell property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartCell { get; set; } +#nullable restore +#else + public Json StartCell { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetPositionPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetPositionPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetPositionPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endCell", n => { EndCell = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startCell", n => { StartCell = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endCell", EndCell); + writer.WriteObjectValue("startCell", StartCell); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionRequestBuilder.cs new file mode 100644 index 0000000000..024ec97639 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/SetPosition/SetPositionRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.SetPosition +{ + /// + /// Provides operations to call the setPosition method. + /// + public class SetPositionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Positions the chart relative to cells on the worksheet. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Positions the chart relative to cells on the worksheet.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chart-setposition?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetPositionPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetPositionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/setPosition", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetPositionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/setPosition", rawUrl) + { + } + /// + /// Positions the chart relative to cells on the worksheet. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetPositionPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetPositionPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..34337ac962 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format.Fill.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the fill color of a chart element. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the fill color of a chart element.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format/fill/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format/fill/clear", rawUrl) + { + } + /// + /// Clear the fill color of a chart element. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs new file mode 100644 index 0000000000..c1d25472c5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/FillRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format.Fill.Clear; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format.Fill.SetSolidColor; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format.Fill +{ + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartTitleFormat entity. + /// + public class FillRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property fill for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fill for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the fill format of an object, which includes background formatting information. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the fill format of an object, which includes background formatting information. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fill in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fill in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFill.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the setSolidColor method. + /// + /// A + public Command BuildSetSolidColorNavCommand() + { + var command = new Command("set-solid-color"); + command.Description = "Provides operations to call the setSolidColor method."; + var builder = new SetSolidColorRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FillRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format/fill{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FillRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format/fill{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fill for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of an object, which includes background formatting information. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fill in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFill body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the fill format of an object, which includes background formatting information. Read-only. + /// + public class FillRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs new file mode 100644 index 0000000000..4025db9fc8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format.Fill.SetSolidColor +{ + #pragma warning disable CS1591 + public class SetSolidColorPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetSolidColorPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetSolidColorPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetSolidColorPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs new file mode 100644 index 0000000000..54be60df67 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Fill/SetSolidColor/SetSolidColorRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format.Fill.SetSolidColor +{ + /// + /// Provides operations to call the setSolidColor method. + /// + public class SetSolidColorRequestBuilder : BaseCliRequestBuilder + { + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Sets the fill formatting of a chart element to a uniform color.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartfill-setsolidcolor?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetSolidColorPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetSolidColorRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format/fill/setSolidColor", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetSolidColorRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format/fill/setSolidColor", rawUrl) + { + } + /// + /// Sets the fill formatting of a chart element to a uniform color. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetSolidColorPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Font/FontRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Font/FontRequestBuilder.cs new file mode 100644 index 0000000000..42f51c955b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/Font/FontRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format.Font +{ + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartTitleFormat entity. + /// + public class FontRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property font for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property font for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property font in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property font in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartFont.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FontRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format/font{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FontRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format/font{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property font for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property font in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartFont body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the font attributes (font name, font size, color, etc.) for the current object. Read-only. + /// + public class FontRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..7fa6b7df66 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/Format/FormatRequestBuilder.cs @@ -0,0 +1,363 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format.Fill; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format.Font; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartTitle entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the fill property of the microsoft.graph.workbookChartTitleFormat entity. + /// + /// A + public Command BuildFillNavCommand() + { + var command = new Command("fill"); + command.Description = "Provides operations to manage the fill property of the microsoft.graph.workbookChartTitleFormat entity."; + var builder = new FillRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildSetSolidColorNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the font property of the microsoft.graph.workbookChartTitleFormat entity. + /// + /// A + public Command BuildFontNavCommand() + { + var command = new Command("font"); + command.Description = "Provides operations to manage the font property of the microsoft.graph.workbookChartTitleFormat entity."; + var builder = new FontRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the formatting of a chart title, which includes fill and font formatting. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the formatting of a chart title, which includes fill and font formatting. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartTitleFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart title, which includes fill and font formatting. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartTitleFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartTitleFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the formatting of a chart title, which includes fill and font formatting. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/TitleRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/TitleRequestBuilder.cs new file mode 100644 index 0000000000..4dce9d770a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Title/TitleRequestBuilder.cs @@ -0,0 +1,343 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title.Format; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title +{ + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChart entity. + /// + public class TitleRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property title for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property title for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChartTitle entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChartTitle entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFillNavCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property title in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property title in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartTitle.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TitleRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TitleRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/title{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property title for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property title in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartTitle body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartTitle body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only. + /// + public class TitleRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/WorkbookChartItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/WorkbookChartItemRequestBuilder.cs new file mode 100644 index 0000000000..faa8f2012a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/WorkbookChartItemRequestBuilder.cs @@ -0,0 +1,604 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Axes; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.DataLabels; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Format; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Image; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.ImageWithWidth; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.ImageWithWidthWithHeight; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.ImageWithWidthWithHeightWithFittingMode; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Legend; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Series; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.SetData; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.SetPosition; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Title; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item +{ + /// + /// Provides operations to manage the charts property of the microsoft.graph.workbookWorksheet entity. + /// + public class WorkbookChartItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the axes property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildAxesNavCommand() + { + var command = new Command("axes"); + command.Description = "Provides operations to manage the axes property of the microsoft.graph.workbookChart entity."; + var builder = new AxesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCategoryAxisNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildSeriesAxisNavCommand()); + nonExecCommands.Add(builder.BuildValueAxisNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the dataLabels property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildDataLabelsNavCommand() + { + var command = new Command("data-labels"); + command.Description = "Provides operations to manage the dataLabels property of the microsoft.graph.workbookChart entity."; + var builder = new DataLabelsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property charts for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property charts for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChart entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFillNavCommand()); + nonExecCommands.Add(builder.BuildFontNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Returns collection of charts that are part of the worksheet. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns collection of charts that are part of the worksheet. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageNavCommand() + { + var command = new Command("image"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageWithWidthRbCommand() + { + var command = new Command("image-with-width"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageWithWidthRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageWithWidthWithHeightRbCommand() + { + var command = new Command("image-with-width-with-height"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageWithWidthWithHeightRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageWithWidthWithHeightWithFittingModeRbCommand() + { + var command = new Command("image-with-width-with-height-with-fitting-mode"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageWithWidthWithHeightWithFittingModeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the legend property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildLegendNavCommand() + { + var command = new Command("legend"); + command.Description = "Provides operations to manage the legend property of the microsoft.graph.workbookChart entity."; + var builder = new LegendRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property charts in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property charts in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChart.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the series property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildSeriesNavCommand() + { + var command = new Command("series"); + command.Description = "Provides operations to manage the series property of the microsoft.graph.workbookChart entity."; + var builder = new SeriesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildItemAtWithIndexRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the setData method. + /// + /// A + public Command BuildSetDataNavCommand() + { + var command = new Command("set-data"); + command.Description = "Provides operations to call the setData method."; + var builder = new SetDataRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the setPosition method. + /// + /// A + public Command BuildSetPositionNavCommand() + { + var command = new Command("set-position"); + command.Description = "Provides operations to call the setPosition method."; + var builder = new SetPositionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildTitleNavCommand() + { + var command = new Command("title"); + command.Description = "Provides operations to manage the title property of the microsoft.graph.workbookChart entity."; + var builder = new TitleRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFormatNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookChart entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookChartItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookChartItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property charts for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns collection of charts that are part of the worksheet. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property charts in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChart body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChart body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns collection of charts that are part of the worksheet. Read-only. + /// + public class WorkbookChartItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..6cb86a77d4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/Item/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,154 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.Item.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookChart entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// The worksheet containing the current chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The worksheet containing the current chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookChartIdOption = new Option("--workbook-chart-id", description: "The unique identifier of workbookChart") { + }; + workbookChartIdOption.IsRequired = true; + command.AddOption(workbookChartIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookChartId = invocationContext.ParseResult.GetValueForOption(workbookChartIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookChartId is not null) requestInfo.PathParameters.Add("workbookChart%2Did", workbookChartId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/{workbookChart%2Did}/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// The worksheet containing the current chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The worksheet containing the current chart. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Axes/AxesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Axes/AxesRequestBuilder.cs new file mode 100644 index 0000000000..859abd1dba --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Axes/AxesRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Axes +{ + /// + /// Provides operations to manage the axes property of the microsoft.graph.workbookChart entity. + /// + public class AxesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property axes for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property axes for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart axes. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart axes. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property axes in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property axes in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxes.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AxesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/axes{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AxesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/axes{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property axes for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart axes. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property axes in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxes body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxes body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart axes. Read-only. + /// + public class AxesRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/DataLabels/DataLabelsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/DataLabels/DataLabelsRequestBuilder.cs new file mode 100644 index 0000000000..ea0724ef54 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/DataLabels/DataLabelsRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.DataLabels +{ + /// + /// Provides operations to manage the dataLabels property of the microsoft.graph.workbookChart entity. + /// + public class DataLabelsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property dataLabels for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property dataLabels for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the data labels on the chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the data labels on the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property dataLabels in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property dataLabels in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartDataLabels.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataLabelsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/dataLabels{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataLabelsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/dataLabels{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property dataLabels for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the data labels on the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property dataLabels in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartDataLabels body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartDataLabels body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the data labels on the chart. Read-only. + /// + public class DataLabelsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..b15c2da0d6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Format/FormatRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChart entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Encapsulates the format properties for the chart area. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Encapsulates the format properties for the chart area. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAreaFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties for the chart area. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAreaFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAreaFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties for the chart area. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Image/ImageGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Image/ImageGetResponse.cs new file mode 100644 index 0000000000..5d6affe6c8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Image/ImageGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Image +{ + #pragma warning disable CS1591 + public class ImageGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Image/ImageRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Image/ImageRequestBuilder.cs new file mode 100644 index 0000000000..22e2e196f2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Image/ImageRequestBuilder.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Image +{ + /// + /// Provides operations to call the image method. + /// + public class ImageRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/image()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/image()", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidth/ImageWithWidthGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidth/ImageWithWidthGetResponse.cs new file mode 100644 index 0000000000..599a0a887f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidth/ImageWithWidthGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.ImageWithWidth +{ + #pragma warning disable CS1591 + public class ImageWithWidthGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageWithWidthGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageWithWidthGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageWithWidthGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidth/ImageWithWidthRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidth/ImageWithWidthRequestBuilder.cs new file mode 100644 index 0000000000..24fc16a3da --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidth/ImageWithWidthRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.ImageWithWidth +{ + /// + /// Provides operations to call the image method. + /// + public class ImageWithWidthRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var widthOption = new Option("--width", description: "Usage: width={width}") { + }; + widthOption.IsRequired = true; + command.AddOption(widthOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var width = invocationContext.ParseResult.GetValueForOption(widthOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (width is not null) requestInfo.PathParameters.Add("width", width); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageWithWidthRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/image(width={width})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageWithWidthRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/image(width={width})", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeight/ImageWithWidthWithHeightGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeight/ImageWithWidthWithHeightGetResponse.cs new file mode 100644 index 0000000000..f350d8a1a7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeight/ImageWithWidthWithHeightGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.ImageWithWidthWithHeight +{ + #pragma warning disable CS1591 + public class ImageWithWidthWithHeightGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageWithWidthWithHeightGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageWithWidthWithHeightGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageWithWidthWithHeightGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs new file mode 100644 index 0000000000..ed5ccd942f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.ImageWithWidthWithHeight +{ + /// + /// Provides operations to call the image method. + /// + public class ImageWithWidthWithHeightRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var widthOption = new Option("--width", description: "Usage: width={width}") { + }; + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}") { + }; + heightOption.IsRequired = true; + command.AddOption(heightOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var width = invocationContext.ParseResult.GetValueForOption(widthOption); + var height = invocationContext.ParseResult.GetValueForOption(heightOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (width is not null) requestInfo.PathParameters.Add("width", width); + if (height is not null) requestInfo.PathParameters.Add("height", height); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageWithWidthWithHeightRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/image(width={width},height={height})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageWithWidthWithHeightRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/image(width={width},height={height})", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeGetResponse.cs new file mode 100644 index 0000000000..20d476574a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.ImageWithWidthWithHeightWithFittingMode +{ + #pragma warning disable CS1591 + public class ImageWithWidthWithHeightWithFittingModeGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageWithWidthWithHeightWithFittingModeGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageWithWidthWithHeightWithFittingModeGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageWithWidthWithHeightWithFittingModeGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs new file mode 100644 index 0000000000..45b0e5b60a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.ImageWithWidthWithHeightWithFittingMode +{ + /// + /// Provides operations to call the image method. + /// + public class ImageWithWidthWithHeightWithFittingModeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var widthOption = new Option("--width", description: "Usage: width={width}") { + }; + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}") { + }; + heightOption.IsRequired = true; + command.AddOption(heightOption); + var fittingModeOption = new Option("--fitting-mode", description: "Usage: fittingMode='{fittingMode}'") { + }; + fittingModeOption.IsRequired = true; + command.AddOption(fittingModeOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var width = invocationContext.ParseResult.GetValueForOption(widthOption); + var height = invocationContext.ParseResult.GetValueForOption(heightOption); + var fittingMode = invocationContext.ParseResult.GetValueForOption(fittingModeOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (width is not null) requestInfo.PathParameters.Add("width", width); + if (height is not null) requestInfo.PathParameters.Add("height", height); + if (fittingMode is not null) requestInfo.PathParameters.Add("fittingMode", fittingMode); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageWithWidthWithHeightWithFittingModeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/image(width={width},height={height},fittingMode='{fittingMode}')", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageWithWidthWithHeightWithFittingModeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/image(width={width},height={height},fittingMode='{fittingMode}')", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs new file mode 100644 index 0000000000..5663750577 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -0,0 +1,360 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Axes; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.DataLabels; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Format; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Image; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.ImageWithWidth; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.ImageWithWidthWithHeight; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.ImageWithWidthWithHeightWithFittingMode; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Legend; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Series; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.SetData; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.SetPosition; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Title; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex +{ + /// + /// Provides operations to call the itemAt method. + /// + public class ItemAtWithIndexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the axes property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildAxesNavCommand() + { + var command = new Command("axes"); + command.Description = "Provides operations to manage the axes property of the microsoft.graph.workbookChart entity."; + var builder = new AxesRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the dataLabels property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildDataLabelsNavCommand() + { + var command = new Command("data-labels"); + command.Description = "Provides operations to manage the dataLabels property of the microsoft.graph.workbookChart entity."; + var builder = new DataLabelsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChart entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Gets a chart based on its position in the collection. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets a chart based on its position in the collection.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chartcollection-itemat?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageNavCommand() + { + var command = new Command("image"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageWithWidthRbCommand() + { + var command = new Command("image-with-width"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageWithWidthRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageWithWidthWithHeightRbCommand() + { + var command = new Command("image-with-width-with-height"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageWithWidthWithHeightRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageWithWidthWithHeightWithFittingModeRbCommand() + { + var command = new Command("image-with-width-with-height-with-fitting-mode"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageWithWidthWithHeightWithFittingModeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the legend property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildLegendNavCommand() + { + var command = new Command("legend"); + command.Description = "Provides operations to manage the legend property of the microsoft.graph.workbookChart entity."; + var builder = new LegendRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the series property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildSeriesNavCommand() + { + var command = new Command("series"); + command.Description = "Provides operations to manage the series property of the microsoft.graph.workbookChart entity."; + var builder = new SeriesRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the setData method. + /// + /// A + public Command BuildSetDataNavCommand() + { + var command = new Command("set-data"); + command.Description = "Provides operations to call the setData method."; + var builder = new SetDataRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the setPosition method. + /// + /// A + public Command BuildSetPositionNavCommand() + { + var command = new Command("set-position"); + command.Description = "Provides operations to call the setPosition method."; + var builder = new SetPositionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildTitleNavCommand() + { + var command = new Command("title"); + command.Description = "Provides operations to manage the title property of the microsoft.graph.workbookChart entity."; + var builder = new TitleRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookChart entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemAtWithIndexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemAtWithIndexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})", rawUrl) + { + } + /// + /// Gets a chart based on its position in the collection. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Legend/LegendRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Legend/LegendRequestBuilder.cs new file mode 100644 index 0000000000..5aec411581 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Legend/LegendRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Legend +{ + /// + /// Provides operations to manage the legend property of the microsoft.graph.workbookChart entity. + /// + public class LegendRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property legend for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property legend for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the legend for the chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the legend for the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property legend in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property legend in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLegend.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LegendRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/legend{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LegendRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/legend{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property legend for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the legend for the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property legend in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLegend body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLegend body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the legend for the chart. Read-only. + /// + public class LegendRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Series/SeriesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Series/SeriesRequestBuilder.cs new file mode 100644 index 0000000000..fa6c857f8f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Series/SeriesRequestBuilder.cs @@ -0,0 +1,333 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Series +{ + /// + /// Provides operations to manage the series property of the microsoft.graph.workbookChart entity. + /// + public class SeriesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents either a single series or collection of series in the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Create new navigation property to series for storage + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Create new navigation property to series for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartSeries.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SeriesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/series{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SeriesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/series{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to series for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookChartSeries body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookChartSeries body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + public class SeriesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetData/SetDataPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetData/SetDataPostRequestBody.cs new file mode 100644 index 0000000000..ba11afa45a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetData/SetDataPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.SetData +{ + #pragma warning disable CS1591 + public class SetDataPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The seriesBy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesBy { get; set; } +#nullable restore +#else + public string SeriesBy { get; set; } +#endif + /// The sourceData property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SourceData { get; set; } +#nullable restore +#else + public Json SourceData { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetDataPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetDataPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetDataPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "seriesBy", n => { SeriesBy = n.GetStringValue(); } }, + { "sourceData", n => { SourceData = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("seriesBy", SeriesBy); + writer.WriteObjectValue("sourceData", SourceData); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetData/SetDataRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetData/SetDataRequestBuilder.cs new file mode 100644 index 0000000000..8eb917d80f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetData/SetDataRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.SetData +{ + /// + /// Provides operations to call the setData method. + /// + public class SetDataRequestBuilder : BaseCliRequestBuilder + { + /// + /// Resets the source data for the chart. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Resets the source data for the chart.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chart-setdata?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetDataPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetDataRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/setData", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetDataRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/setData", rawUrl) + { + } + /// + /// Resets the source data for the chart. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetDataPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetDataPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetPosition/SetPositionPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetPosition/SetPositionPostRequestBody.cs new file mode 100644 index 0000000000..4cb14c2d4f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetPosition/SetPositionPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.SetPosition +{ + #pragma warning disable CS1591 + public class SetPositionPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endCell property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndCell { get; set; } +#nullable restore +#else + public Json EndCell { get; set; } +#endif + /// The startCell property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartCell { get; set; } +#nullable restore +#else + public Json StartCell { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetPositionPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetPositionPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetPositionPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endCell", n => { EndCell = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startCell", n => { StartCell = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endCell", EndCell); + writer.WriteObjectValue("startCell", StartCell); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetPosition/SetPositionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetPosition/SetPositionRequestBuilder.cs new file mode 100644 index 0000000000..3a391116b4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/SetPosition/SetPositionRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.SetPosition +{ + /// + /// Provides operations to call the setPosition method. + /// + public class SetPositionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Positions the chart relative to cells on the worksheet. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Positions the chart relative to cells on the worksheet.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chart-setposition?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetPositionPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetPositionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/setPosition", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetPositionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/setPosition", rawUrl) + { + } + /// + /// Positions the chart relative to cells on the worksheet. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetPositionPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetPositionPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Title/TitleRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Title/TitleRequestBuilder.cs new file mode 100644 index 0000000000..6474bbcd96 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Title/TitleRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Title +{ + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChart entity. + /// + public class TitleRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property title for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property title for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property title in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property title in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartTitle.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TitleRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/title{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TitleRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/title{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property title for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property title in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartTitle body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartTitle body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only. + /// + public class TitleRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..068c57e46a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemAtWithIndex/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,154 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemAtWithIndex.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookChart entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// The worksheet containing the current chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The worksheet containing the current chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/itemAt(index={index})/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// The worksheet containing the current chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The worksheet containing the current chart. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Axes/AxesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Axes/AxesRequestBuilder.cs new file mode 100644 index 0000000000..83b5ca5bd3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Axes/AxesRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Axes +{ + /// + /// Provides operations to manage the axes property of the microsoft.graph.workbookChart entity. + /// + public class AxesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property axes for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property axes for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents chart axes. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents chart axes. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property axes in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property axes in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAxes.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AxesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/axes{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AxesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/axes{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property axes for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart axes. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property axes in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAxes body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAxes body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents chart axes. Read-only. + /// + public class AxesRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/DataLabels/DataLabelsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/DataLabels/DataLabelsRequestBuilder.cs new file mode 100644 index 0000000000..1ac3d7abda --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/DataLabels/DataLabelsRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.DataLabels +{ + /// + /// Provides operations to manage the dataLabels property of the microsoft.graph.workbookChart entity. + /// + public class DataLabelsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property dataLabels for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property dataLabels for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the data labels on the chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the data labels on the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property dataLabels in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property dataLabels in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartDataLabels.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataLabelsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/dataLabels{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataLabelsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/dataLabels{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property dataLabels for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the data labels on the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property dataLabels in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartDataLabels body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartDataLabels body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the data labels on the chart. Read-only. + /// + public class DataLabelsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Format/FormatRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Format/FormatRequestBuilder.cs new file mode 100644 index 0000000000..041a18aa03 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Format/FormatRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Format +{ + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChart entity. + /// + public class FormatRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property format for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property format for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Encapsulates the format properties for the chart area. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Encapsulates the format properties for the chart area. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property format in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property format in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartAreaFormat.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FormatRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/format{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FormatRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/format{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property format for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties for the chart area. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property format in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartAreaFormat body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartAreaFormat body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Encapsulates the format properties for the chart area. Read-only. + /// + public class FormatRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Image/ImageGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Image/ImageGetResponse.cs new file mode 100644 index 0000000000..f4a735add9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Image/ImageGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Image +{ + #pragma warning disable CS1591 + public class ImageGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Image/ImageRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Image/ImageRequestBuilder.cs new file mode 100644 index 0000000000..a2a64232cb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Image/ImageRequestBuilder.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Image +{ + /// + /// Provides operations to call the image method. + /// + public class ImageRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/image()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/image()", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidth/ImageWithWidthGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidth/ImageWithWidthGetResponse.cs new file mode 100644 index 0000000000..f21d71456c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidth/ImageWithWidthGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.ImageWithWidth +{ + #pragma warning disable CS1591 + public class ImageWithWidthGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageWithWidthGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageWithWidthGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageWithWidthGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidth/ImageWithWidthRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidth/ImageWithWidthRequestBuilder.cs new file mode 100644 index 0000000000..1eaa90c16f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidth/ImageWithWidthRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.ImageWithWidth +{ + /// + /// Provides operations to call the image method. + /// + public class ImageWithWidthRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var widthOption = new Option("--width", description: "Usage: width={width}") { + }; + widthOption.IsRequired = true; + command.AddOption(widthOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var width = invocationContext.ParseResult.GetValueForOption(widthOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + if (width is not null) requestInfo.PathParameters.Add("width", width); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageWithWidthRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/image(width={width})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageWithWidthRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/image(width={width})", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeight/ImageWithWidthWithHeightGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeight/ImageWithWidthWithHeightGetResponse.cs new file mode 100644 index 0000000000..2c67208cb6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeight/ImageWithWidthWithHeightGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.ImageWithWidthWithHeight +{ + #pragma warning disable CS1591 + public class ImageWithWidthWithHeightGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageWithWidthWithHeightGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageWithWidthWithHeightGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageWithWidthWithHeightGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs new file mode 100644 index 0000000000..3bb6e494c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeight/ImageWithWidthWithHeightRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.ImageWithWidthWithHeight +{ + /// + /// Provides operations to call the image method. + /// + public class ImageWithWidthWithHeightRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var widthOption = new Option("--width", description: "Usage: width={width}") { + }; + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}") { + }; + heightOption.IsRequired = true; + command.AddOption(heightOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var width = invocationContext.ParseResult.GetValueForOption(widthOption); + var height = invocationContext.ParseResult.GetValueForOption(heightOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + if (width is not null) requestInfo.PathParameters.Add("width", width); + if (height is not null) requestInfo.PathParameters.Add("height", height); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageWithWidthWithHeightRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/image(width={width},height={height})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageWithWidthWithHeightRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/image(width={width},height={height})", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeGetResponse.cs new file mode 100644 index 0000000000..bad2e6d336 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeGetResponse.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.ImageWithWidthWithHeightWithFittingMode +{ + #pragma warning disable CS1591 + public class ImageWithWidthWithHeightWithFittingModeGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ImageWithWidthWithHeightWithFittingModeGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ImageWithWidthWithHeightWithFittingModeGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageWithWidthWithHeightWithFittingModeGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs new file mode 100644 index 0000000000..63d41710bd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ImageWithWidthWithHeightWithFittingMode/ImageWithWidthWithHeightWithFittingModeRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.ImageWithWidthWithHeightWithFittingMode +{ + /// + /// Provides operations to call the image method. + /// + public class ImageWithWidthWithHeightWithFittingModeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function image + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function image"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var widthOption = new Option("--width", description: "Usage: width={width}") { + }; + widthOption.IsRequired = true; + command.AddOption(widthOption); + var heightOption = new Option("--height", description: "Usage: height={height}") { + }; + heightOption.IsRequired = true; + command.AddOption(heightOption); + var fittingModeOption = new Option("--fitting-mode", description: "Usage: fittingMode='{fittingMode}'") { + }; + fittingModeOption.IsRequired = true; + command.AddOption(fittingModeOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var width = invocationContext.ParseResult.GetValueForOption(widthOption); + var height = invocationContext.ParseResult.GetValueForOption(heightOption); + var fittingMode = invocationContext.ParseResult.GetValueForOption(fittingModeOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + if (width is not null) requestInfo.PathParameters.Add("width", width); + if (height is not null) requestInfo.PathParameters.Add("height", height); + if (fittingMode is not null) requestInfo.PathParameters.Add("fittingMode", fittingMode); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ImageWithWidthWithHeightWithFittingModeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/image(width={width},height={height},fittingMode='{fittingMode}')", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ImageWithWidthWithHeightWithFittingModeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/image(width={width},height={height},fittingMode='{fittingMode}')", rawUrl) + { + } + /// + /// Invoke function image + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ItemWithNameRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ItemWithNameRequestBuilder.cs new file mode 100644 index 0000000000..9850fc28b3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/ItemWithNameRequestBuilder.cs @@ -0,0 +1,359 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Axes; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.DataLabels; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Format; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Image; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.ImageWithWidth; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.ImageWithWidthWithHeight; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.ImageWithWidthWithHeightWithFittingMode; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Legend; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Series; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.SetData; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.SetPosition; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Title; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName +{ + /// + /// Provides operations to call the item method. + /// + public class ItemWithNameRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the axes property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildAxesNavCommand() + { + var command = new Command("axes"); + command.Description = "Provides operations to manage the axes property of the microsoft.graph.workbookChart entity."; + var builder = new AxesRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the dataLabels property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildDataLabelsNavCommand() + { + var command = new Command("data-labels"); + command.Description = "Provides operations to manage the dataLabels property of the microsoft.graph.workbookChart entity."; + var builder = new DataLabelsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the format property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildFormatNavCommand() + { + var command = new Command("format"); + command.Description = "Provides operations to manage the format property of the microsoft.graph.workbookChart entity."; + var builder = new FormatRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Invoke function item + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function item"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageNavCommand() + { + var command = new Command("image"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageWithWidthRbCommand() + { + var command = new Command("image-with-width"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageWithWidthRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageWithWidthWithHeightRbCommand() + { + var command = new Command("image-with-width-with-height"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageWithWidthWithHeightRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the image method. + /// + /// A + public Command BuildImageWithWidthWithHeightWithFittingModeRbCommand() + { + var command = new Command("image-with-width-with-height-with-fitting-mode"); + command.Description = "Provides operations to call the image method."; + var builder = new ImageWithWidthWithHeightWithFittingModeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the legend property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildLegendNavCommand() + { + var command = new Command("legend"); + command.Description = "Provides operations to manage the legend property of the microsoft.graph.workbookChart entity."; + var builder = new LegendRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the series property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildSeriesNavCommand() + { + var command = new Command("series"); + command.Description = "Provides operations to manage the series property of the microsoft.graph.workbookChart entity."; + var builder = new SeriesRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the setData method. + /// + /// A + public Command BuildSetDataNavCommand() + { + var command = new Command("set-data"); + command.Description = "Provides operations to call the setData method."; + var builder = new SetDataRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the setPosition method. + /// + /// A + public Command BuildSetPositionNavCommand() + { + var command = new Command("set-position"); + command.Description = "Provides operations to call the setPosition method."; + var builder = new SetPositionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildTitleNavCommand() + { + var command = new Command("title"); + command.Description = "Provides operations to manage the title property of the microsoft.graph.workbookChart entity."; + var builder = new TitleRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookChart entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookChart entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemWithNameRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemWithNameRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')", rawUrl) + { + } + /// + /// Invoke function item + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Legend/LegendRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Legend/LegendRequestBuilder.cs new file mode 100644 index 0000000000..4934cd4424 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Legend/LegendRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Legend +{ + /// + /// Provides operations to manage the legend property of the microsoft.graph.workbookChart entity. + /// + public class LegendRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property legend for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property legend for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the legend for the chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the legend for the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property legend in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property legend in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartLegend.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LegendRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/legend{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LegendRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/legend{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property legend for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the legend for the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property legend in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartLegend body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartLegend body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the legend for the chart. Read-only. + /// + public class LegendRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Series/SeriesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Series/SeriesRequestBuilder.cs new file mode 100644 index 0000000000..a5a2d6487a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Series/SeriesRequestBuilder.cs @@ -0,0 +1,333 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Series +{ + /// + /// Provides operations to manage the series property of the microsoft.graph.workbookChart entity. + /// + public class SeriesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents either a single series or collection of series in the chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Create new navigation property to series for storage + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Create new navigation property to series for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartSeries.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SeriesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/series{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SeriesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/series{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to series for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookChartSeries body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookChartSeries body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents either a single series or collection of series in the chart. Read-only. + /// + public class SeriesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetData/SetDataPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetData/SetDataPostRequestBody.cs new file mode 100644 index 0000000000..aadda0c6a5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetData/SetDataPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.SetData +{ + #pragma warning disable CS1591 + public class SetDataPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The seriesBy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesBy { get; set; } +#nullable restore +#else + public string SeriesBy { get; set; } +#endif + /// The sourceData property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? SourceData { get; set; } +#nullable restore +#else + public Json SourceData { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetDataPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetDataPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetDataPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "seriesBy", n => { SeriesBy = n.GetStringValue(); } }, + { "sourceData", n => { SourceData = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("seriesBy", SeriesBy); + writer.WriteObjectValue("sourceData", SourceData); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetData/SetDataRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetData/SetDataRequestBuilder.cs new file mode 100644 index 0000000000..fa64252038 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetData/SetDataRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.SetData +{ + /// + /// Provides operations to call the setData method. + /// + public class SetDataRequestBuilder : BaseCliRequestBuilder + { + /// + /// Resets the source data for the chart. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Resets the source data for the chart.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chart-setdata?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetDataPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetDataRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/setData", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetDataRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/setData", rawUrl) + { + } + /// + /// Resets the source data for the chart. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetDataPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetDataPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetPosition/SetPositionPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetPosition/SetPositionPostRequestBody.cs new file mode 100644 index 0000000000..2141332163 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetPosition/SetPositionPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.SetPosition +{ + #pragma warning disable CS1591 + public class SetPositionPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The endCell property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? EndCell { get; set; } +#nullable restore +#else + public Json EndCell { get; set; } +#endif + /// The startCell property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? StartCell { get; set; } +#nullable restore +#else + public Json StartCell { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public SetPositionPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static SetPositionPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetPositionPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "endCell", n => { EndCell = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + { "startCell", n => { StartCell = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("endCell", EndCell); + writer.WriteObjectValue("startCell", StartCell); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetPosition/SetPositionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetPosition/SetPositionRequestBuilder.cs new file mode 100644 index 0000000000..f5250b84a6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/SetPosition/SetPositionRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.SetPosition +{ + /// + /// Provides operations to call the setPosition method. + /// + public class SetPositionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Positions the chart relative to cells on the worksheet. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Positions the chart relative to cells on the worksheet.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/chart-setposition?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(SetPositionPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SetPositionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/setPosition", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SetPositionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/setPosition", rawUrl) + { + } + /// + /// Positions the chart relative to cells on the worksheet. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetPositionPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetPositionPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Title/TitleRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Title/TitleRequestBuilder.cs new file mode 100644 index 0000000000..58a6d7bb6b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Title/TitleRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Title +{ + /// + /// Provides operations to manage the title property of the microsoft.graph.workbookChart entity. + /// + public class TitleRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property title for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property title for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property title in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property title in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookChartTitle.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TitleRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/title{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TitleRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/title{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property title for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property title in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookChartTitle body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookChartTitle body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the title of the specified chart, including the text, visibility, position and formatting of the title. Read-only. + /// + public class TitleRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..f95a59aafd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Charts/ItemWithName/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,154 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts.ItemWithName.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookChart entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// The worksheet containing the current chart. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The worksheet containing the current chart. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var nameOption = new Option("--name", description: "Usage: name='{name}'") { + }; + nameOption.IsRequired = true; + command.AddOption(nameOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var name = invocationContext.ParseResult.GetValueForOption(nameOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (name is not null) requestInfo.PathParameters.Add("name", name); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/charts/item(name='{name}')/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// The worksheet containing the current chart. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The worksheet containing the current chart. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..a192a0b077 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Add/AddPostRequestBody.cs @@ -0,0 +1,83 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The comment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Comment { get; set; } +#nullable restore +#else + public string Comment { get; set; } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The reference property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Reference { get; set; } +#nullable restore +#else + public Json Reference { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "comment", n => { Comment = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "reference", n => { Reference = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("comment", Comment); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("reference", Reference); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..14419800de --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Add/AddRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Adds a new name to the collection of the given scope using the user's locale for the formula. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Adds a new name to the collection of the given scope using the user's locale for the formula.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/nameditem-add?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/add", rawUrl) + { + } + /// + /// Adds a new name to the collection of the given scope using the user's locale for the formula. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalPostRequestBody.cs new file mode 100644 index 0000000000..53c26896db --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalPostRequestBody.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.AddFormulaLocal +{ + #pragma warning disable CS1591 + public class AddFormulaLocalPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The comment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Comment { get; set; } +#nullable restore +#else + public string Comment { get; set; } +#endif + /// The formula property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Formula { get; set; } +#nullable restore +#else + public string Formula { get; set; } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddFormulaLocalPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddFormulaLocalPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddFormulaLocalPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "comment", n => { Comment = n.GetStringValue(); } }, + { "formula", n => { Formula = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("comment", Comment); + writer.WriteStringValue("formula", Formula); + writer.WriteStringValue("name", Name); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs new file mode 100644 index 0000000000..ee489b4e62 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/AddFormulaLocal/AddFormulaLocalRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.AddFormulaLocal +{ + /// + /// Provides operations to call the addFormulaLocal method. + /// + public class AddFormulaLocalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Adds a new name to the collection of the given scope using the user's locale for the formula. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Adds a new name to the collection of the given scope using the user's locale for the formula.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/nameditem-addformulalocal?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddFormulaLocalPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddFormulaLocalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/addFormulaLocal", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddFormulaLocalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/addFormulaLocal", rawUrl) + { + } + /// + /// Adds a new name to the collection of the given scope using the user's locale for the formula. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddFormulaLocalPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddFormulaLocalPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..e2d4d523fc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Count/CountRequestBuilder.cs @@ -0,0 +1,137 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Item/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..7cb513d83e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Item/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Item.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/nameditem-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/{workbookNamedItem%2Did}/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/{workbookNamedItem%2Did}/range()", rawUrl) + { + } + /// + /// Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Item/WorkbookNamedItemItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Item/WorkbookNamedItemItemRequestBuilder.cs new file mode 100644 index 0000000000..42a32a1f6e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Item/WorkbookNamedItemItemRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Item.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Item.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Item +{ + /// + /// Provides operations to manage the names property of the microsoft.graph.workbookWorksheet entity. + /// + public class WorkbookNamedItemItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property names for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property names for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Returns collection of names that are associated with the worksheet. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property names in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property names in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookNamedItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookNamedItem entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookNamedItem entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookNamedItemItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/{workbookNamedItem%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookNamedItemItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/{workbookNamedItem%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property names for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns collection of names that are associated with the worksheet. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property names in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookNamedItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookNamedItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns collection of names that are associated with the worksheet. Read-only. + /// + public class WorkbookNamedItemItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..279dff1b63 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/Item/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,154 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Item.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookNamedItem entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookNamedItemIdOption = new Option("--workbook-named-item-id", description: "The unique identifier of workbookNamedItem") { + }; + workbookNamedItemIdOption.IsRequired = true; + command.AddOption(workbookNamedItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookNamedItemId = invocationContext.ParseResult.GetValueForOption(workbookNamedItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookNamedItemId is not null) requestInfo.PathParameters.Add("workbookNamedItem%2Did", workbookNamedItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/{workbookNamedItem%2Did}/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names/{workbookNamedItem%2Did}/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/NamesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/NamesRequestBuilder.cs new file mode 100644 index 0000000000..c91d8d6a85 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Names/NamesRequestBuilder.cs @@ -0,0 +1,392 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.AddFormulaLocal; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names +{ + /// + /// Provides operations to manage the names property of the microsoft.graph.workbookWorksheet entity. + /// + public class NamesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the addFormulaLocal method. + /// + /// A + public Command BuildAddFormulaLocalNavCommand() + { + var command = new Command("add-formula-local"); + command.Description = "Provides operations to call the addFormulaLocal method."; + var builder = new AddFormulaLocalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the names property of the microsoft.graph.workbookWorksheet entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookNamedItemItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRangeNavCommand()); + commands.Add(builder.BuildWorksheetNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to names for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to names for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookNamedItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Returns collection of names that are associated with the worksheet. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Returns collection of names that are associated with the worksheet. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public NamesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public NamesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/names{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Returns collection of names that are associated with the worksheet. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to names for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookNamedItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookNamedItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns collection of names that are associated with the worksheet. Read-only. + /// + public class NamesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..4b8dca6c8a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Count/CountRequestBuilder.cs @@ -0,0 +1,137 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Item/Refresh/RefreshRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Item/Refresh/RefreshRequestBuilder.cs new file mode 100644 index 0000000000..e869ddb9a5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Item/Refresh/RefreshRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.Item.Refresh +{ + /// + /// Provides operations to call the refresh method. + /// + public class RefreshRequestBuilder : BaseCliRequestBuilder + { + /// + /// Refreshes the PivotTable. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Refreshes the PivotTable.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/workbookpivottable-refresh?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbook-pivot-table-id", description: "The unique identifier of workbookPivotTable") { + }; + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookPivotTableId = invocationContext.ParseResult.GetValueForOption(workbookPivotTableIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookPivotTableId is not null) requestInfo.PathParameters.Add("workbookPivotTable%2Did", workbookPivotTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RefreshRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/{workbookPivotTable%2Did}/refresh", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RefreshRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/{workbookPivotTable%2Did}/refresh", rawUrl) + { + } + /// + /// Refreshes the PivotTable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Item/WorkbookPivotTableItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Item/WorkbookPivotTableItemRequestBuilder.cs new file mode 100644 index 0000000000..c3051b6420 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Item/WorkbookPivotTableItemRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.Item.Refresh; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.Item.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.Item +{ + /// + /// Provides operations to manage the pivotTables property of the microsoft.graph.workbookWorksheet entity. + /// + public class WorkbookPivotTableItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property pivotTables for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property pivotTables for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbook-pivot-table-id", description: "The unique identifier of workbookPivotTable") { + }; + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookPivotTableId = invocationContext.ParseResult.GetValueForOption(workbookPivotTableIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookPivotTableId is not null) requestInfo.PathParameters.Add("workbookPivotTable%2Did", workbookPivotTableId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Collection of PivotTables that are part of the worksheet. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Collection of PivotTables that are part of the worksheet."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbook-pivot-table-id", description: "The unique identifier of workbookPivotTable") { + }; + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookPivotTableId = invocationContext.ParseResult.GetValueForOption(workbookPivotTableIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookPivotTableId is not null) requestInfo.PathParameters.Add("workbookPivotTable%2Did", workbookPivotTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property pivotTables in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property pivotTables in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbook-pivot-table-id", description: "The unique identifier of workbookPivotTable") { + }; + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookPivotTableId = invocationContext.ParseResult.GetValueForOption(workbookPivotTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookPivotTable.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookPivotTableId is not null) requestInfo.PathParameters.Add("workbookPivotTable%2Did", workbookPivotTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the refresh method. + /// + /// A + public Command BuildRefreshNavCommand() + { + var command = new Command("refresh"); + command.Description = "Provides operations to call the refresh method."; + var builder = new RefreshRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookPivotTable entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookPivotTable entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookPivotTableItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/{workbookPivotTable%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookPivotTableItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/{workbookPivotTable%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property pivotTables for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of PivotTables that are part of the worksheet. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property pivotTables in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookPivotTable body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookPivotTable body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of PivotTables that are part of the worksheet. + /// + public class WorkbookPivotTableItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..30df43dc76 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/Item/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,154 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.Item.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookPivotTable entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// The worksheet containing the current PivotTable. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The worksheet containing the current PivotTable. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookPivotTableIdOption = new Option("--workbook-pivot-table-id", description: "The unique identifier of workbookPivotTable") { + }; + workbookPivotTableIdOption.IsRequired = true; + command.AddOption(workbookPivotTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookPivotTableId = invocationContext.ParseResult.GetValueForOption(workbookPivotTableIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookPivotTableId is not null) requestInfo.PathParameters.Add("workbookPivotTable%2Did", workbookPivotTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/{workbookPivotTable%2Did}/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/{workbookPivotTable%2Did}/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// The worksheet containing the current PivotTable. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The worksheet containing the current PivotTable. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/PivotTablesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/PivotTablesRequestBuilder.cs new file mode 100644 index 0000000000..b6482c9d90 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/PivotTablesRequestBuilder.cs @@ -0,0 +1,374 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.RefreshAll; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables +{ + /// + /// Provides operations to manage the pivotTables property of the microsoft.graph.workbookWorksheet entity. + /// + public class PivotTablesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the pivotTables property of the microsoft.graph.workbookWorksheet entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookPivotTableItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRefreshNavCommand()); + commands.Add(builder.BuildWorksheetNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to pivotTables for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to pivotTables for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookPivotTable.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Collection of PivotTables that are part of the worksheet. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Collection of PivotTables that are part of the worksheet."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the refreshAll method. + /// + /// A + public Command BuildRefreshAllNavCommand() + { + var command = new Command("refresh-all"); + command.Description = "Provides operations to call the refreshAll method."; + var builder = new RefreshAllRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PivotTablesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PivotTablesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Collection of PivotTables that are part of the worksheet. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to pivotTables for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookPivotTable body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookPivotTable body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of PivotTables that are part of the worksheet. + /// + public class PivotTablesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs new file mode 100644 index 0000000000..e4e0f46b1b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/PivotTables/RefreshAll/RefreshAllRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables.RefreshAll +{ + /// + /// Provides operations to call the refreshAll method. + /// + public class RefreshAllRequestBuilder : BaseCliRequestBuilder + { + /// + /// Refreshes the PivotTable within a given worksheet. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Refreshes the PivotTable within a given worksheet.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/workbookpivottable-refreshall?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RefreshAllRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/refreshAll", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RefreshAllRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/pivotTables/refreshAll", rawUrl) + { + } + /// + /// Refreshes the PivotTable within a given worksheet. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectPostRequestBody.cs new file mode 100644 index 0000000000..03fea613cd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Protection.Protect +{ + #pragma warning disable CS1591 + public class ProtectPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The options property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public WorkbookWorksheetProtectionOptions? Options { get; set; } +#nullable restore +#else + public WorkbookWorksheetProtectionOptions Options { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ProtectPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ProtectPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ProtectPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "options", n => { Options = n.GetObjectValue(WorkbookWorksheetProtectionOptions.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("options", Options); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectRequestBuilder.cs new file mode 100644 index 0000000000..db415caddb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/Protect/ProtectRequestBuilder.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Protection.Protect +{ + /// + /// Provides operations to call the protect method. + /// + public class ProtectRequestBuilder : BaseCliRequestBuilder + { + /// + /// Protect a worksheet. It throws if the worksheet has been protected. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Protect a worksheet. It throws if the worksheet has been protected.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/worksheetprotection-protect?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ProtectPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ProtectRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/protection/protect", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ProtectRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/protection/protect", rawUrl) + { + } + /// + /// Protect a worksheet. It throws if the worksheet has been protected. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ProtectPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ProtectPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/ProtectionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/ProtectionRequestBuilder.cs new file mode 100644 index 0000000000..c82d863da6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/ProtectionRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Protection.Protect; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Protection.Unprotect; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Protection +{ + /// + /// Provides operations to manage the protection property of the microsoft.graph.workbookWorksheet entity. + /// + public class ProtectionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property protection for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property protection for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Returns sheet protection object for a worksheet. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Returns sheet protection object for a worksheet. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property protection in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property protection in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookWorksheetProtection.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the protect method. + /// + /// A + public Command BuildProtectNavCommand() + { + var command = new Command("protect"); + command.Description = "Provides operations to call the protect method."; + var builder = new ProtectRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the unprotect method. + /// + /// A + public Command BuildUnprotectNavCommand() + { + var command = new Command("unprotect"); + command.Description = "Provides operations to call the unprotect method."; + var builder = new UnprotectRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ProtectionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/protection{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ProtectionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/protection{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property protection for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns sheet protection object for a worksheet. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property protection in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookWorksheetProtection body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookWorksheetProtection body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns sheet protection object for a worksheet. Read-only. + /// + public class ProtectionRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/Unprotect/UnprotectRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/Unprotect/UnprotectRequestBuilder.cs new file mode 100644 index 0000000000..4a954e8ff0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Protection/Unprotect/UnprotectRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Protection.Unprotect +{ + /// + /// Provides operations to call the unprotect method. + /// + public class UnprotectRequestBuilder : BaseCliRequestBuilder + { + /// + /// Unprotect a worksheet + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Unprotect a worksheet\n\nFind more info here:\n https://learn.microsoft.com/graph/api/worksheetprotection-unprotect?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public UnprotectRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/protection/unprotect", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public UnprotectRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/protection/unprotect", rawUrl) + { + } + /// + /// Unprotect a worksheet + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..ebbfa7df7e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,108 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function range + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function range"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/range()", rawUrl) + { + } + /// + /// Invoke function range + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/RangeWithAddress/RangeWithAddressRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/RangeWithAddress/RangeWithAddressRequestBuilder.cs new file mode 100644 index 0000000000..f13a7bcb49 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/RangeWithAddress/RangeWithAddressRequestBuilder.cs @@ -0,0 +1,114 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.RangeWithAddress +{ + /// + /// Provides operations to call the range method. + /// + public class RangeWithAddressRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function range + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function range"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var addressOption = new Option("--address", description: "Usage: address='{address}'") { + }; + addressOption.IsRequired = true; + command.AddOption(addressOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var address = invocationContext.ParseResult.GetValueForOption(addressOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (address is not null) requestInfo.PathParameters.Add("address", address); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeWithAddressRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/range(address='{address}')", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeWithAddressRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/range(address='{address}')", rawUrl) + { + } + /// + /// Invoke function range + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..ab7f6968a8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Add/AddPostRequestBody.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The address property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Address { get; set; } +#nullable restore +#else + public string Address { get; set; } +#endif + /// The hasHeaders property + public bool? HasHeaders { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "address", n => { Address = n.GetStringValue(); } }, + { "hasHeaders", n => { HasHeaders = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("address", Address); + writer.WriteBoolValue("hasHeaders", HasHeaders); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..3f114e0e31 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Add/AddRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Use this API to create a new Table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Use this API to create a new Table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/workbook-post-tables?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/add", rawUrl) + { + } + /// + /// Use this API to create a new Table. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Count/CountGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Count/CountGetResponse.cs new file mode 100644 index 0000000000..ee6686dfc3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Count/CountGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Count +{ + #pragma warning disable CS1591 + public class CountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public int? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..e5e655aaf5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Count/CountRequestBuilder.cs @@ -0,0 +1,107 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function count + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/count()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/count()", rawUrl) + { + } + /// + /// Invoke function count + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs new file mode 100644 index 0000000000..c376d216de --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/ClearFilters/ClearFiltersRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.ClearFilters +{ + /// + /// Provides operations to call the clearFilters method. + /// + public class ClearFiltersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clears all the filters currently applied on the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clears all the filters currently applied on the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-clearfilters?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearFiltersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/clearFilters", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearFiltersRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/clearFilters", rawUrl) + { + } + /// + /// Clears all the filters currently applied on the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..73d438f1e4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Add/AddPostRequestBody.cs @@ -0,0 +1,77 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The index property + public int? Index { get; set; } + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "index", n => { Index = n.GetIntValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("index", Index); + writer.WriteStringValue("name", Name); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..7c16b5a683 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Add/AddRequestBuilder.cs @@ -0,0 +1,130 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Adds a new column to the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Adds a new column to the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumncollection-add?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/add", rawUrl) + { + } + /// + /// Adds a new column to the table. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ColumnsRequestBuilder.cs new file mode 100644 index 0000000000..5b802a9483 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ColumnsRequestBuilder.cs @@ -0,0 +1,417 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + public class ColumnsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookTableColumnItemRequestBuilder(PathParameters); + commands.Add(builder.BuildDataBodyRangeNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildFilterNavCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildHeaderRowRangeNavCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRangeNavCommand()); + commands.Add(builder.BuildTotalRowRangeNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableColumn.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the itemAt method. + /// + /// A + public Command BuildItemAtWithIndexRbCommand() + { + var command = new Command("item-at-with-index"); + command.Description = "Provides operations to call the itemAt method."; + var builder = new ItemAtWithIndexRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildDataBodyRangeNavCommand()); + nonExecCommands.Add(builder.BuildFilterNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildHeaderRowRangeNavCommand()); + nonExecCommands.Add(builder.BuildRangeNavCommand()); + nonExecCommands.Add(builder.BuildTotalRowRangeNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents a collection of all the columns in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTableColumn body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTableColumn body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + public class ColumnsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountGetResponse.cs new file mode 100644 index 0000000000..bb8bf32970 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Count +{ + #pragma warning disable CS1591 + public class CountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public int? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..075a60cb01 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Count/CountRequestBuilder.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function count + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/count()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/count()", rawUrl) + { + } + /// + /// Invoke function count + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs new file mode 100644 index 0000000000..d4ac39c1c9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.DataBodyRange +{ + /// + /// Provides operations to call the dataBodyRange method. + /// + public class DataBodyRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the data body of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the data body of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-databodyrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataBodyRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/dataBodyRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataBodyRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/dataBodyRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the data body of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyPostRequestBody.cs new file mode 100644 index 0000000000..8a02dc7147 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.Apply +{ + #pragma warning disable CS1591 + public class ApplyPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public WorkbookFilterCriteria? Criteria { get; set; } +#nullable restore +#else + public WorkbookFilterCriteria Criteria { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetObjectValue(WorkbookFilterCriteria.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("criteria", Criteria); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs new file mode 100644 index 0000000000..276d07cb9d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Apply/ApplyRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.Apply +{ + /// + /// Provides operations to call the apply method. + /// + public class ApplyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Apply the given filter criteria on the given column. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Apply the given filter criteria on the given column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/filter-apply?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/apply", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/apply", rawUrl) + { + } + /// + /// Apply the given filter criteria on the given column. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterPostRequestBody.cs new file mode 100644 index 0000000000..1c2501c049 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterPostRequestBody.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyBottomItemsFilter +{ + #pragma warning disable CS1591 + public class ApplyBottomItemsFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The count property + public int? Count { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ApplyBottomItemsFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyBottomItemsFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyBottomItemsFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "count", n => { Count = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("count", Count); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs new file mode 100644 index 0000000000..02f8f02dd9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomItemsFilter/ApplyBottomItemsFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyBottomItemsFilter +{ + /// + /// Provides operations to call the applyBottomItemsFilter method. + /// + public class ApplyBottomItemsFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyBottomItemsFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyBottomItemsFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyBottomItemsFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyBottomItemsFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyBottomItemsFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyBottomItemsFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyBottomItemsFilter", rawUrl) + { + } + /// + /// Invoke action applyBottomItemsFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyBottomItemsFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyBottomItemsFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterPostRequestBody.cs new file mode 100644 index 0000000000..7960cbdf4b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterPostRequestBody.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyBottomPercentFilter +{ + #pragma warning disable CS1591 + public class ApplyBottomPercentFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The percent property + public int? Percent { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ApplyBottomPercentFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyBottomPercentFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyBottomPercentFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "percent", n => { Percent = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("percent", Percent); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs new file mode 100644 index 0000000000..96230bebf8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyBottomPercentFilter/ApplyBottomPercentFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyBottomPercentFilter +{ + /// + /// Provides operations to call the applyBottomPercentFilter method. + /// + public class ApplyBottomPercentFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyBottomPercentFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyBottomPercentFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyBottomPercentFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyBottomPercentFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyBottomPercentFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyBottomPercentFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyBottomPercentFilter", rawUrl) + { + } + /// + /// Invoke action applyBottomPercentFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyBottomPercentFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyBottomPercentFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterPostRequestBody.cs new file mode 100644 index 0000000000..d124e542aa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyCellColorFilter +{ + #pragma warning disable CS1591 + public class ApplyCellColorFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyCellColorFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyCellColorFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyCellColorFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs new file mode 100644 index 0000000000..dc4042057f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCellColorFilter/ApplyCellColorFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyCellColorFilter +{ + /// + /// Provides operations to call the applyCellColorFilter method. + /// + public class ApplyCellColorFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyCellColorFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyCellColorFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyCellColorFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyCellColorFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyCellColorFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyCellColorFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyCellColorFilter", rawUrl) + { + } + /// + /// Invoke action applyCellColorFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyCellColorFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyCellColorFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterPostRequestBody.cs new file mode 100644 index 0000000000..7cab610de0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterPostRequestBody.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyCustomFilter +{ + #pragma warning disable CS1591 + public class ApplyCustomFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria1 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Criteria1 { get; set; } +#nullable restore +#else + public string Criteria1 { get; set; } +#endif + /// The criteria2 property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Criteria2 { get; set; } +#nullable restore +#else + public string Criteria2 { get; set; } +#endif + /// The oper property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Oper { get; set; } +#nullable restore +#else + public string Oper { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyCustomFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyCustomFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyCustomFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria1", n => { Criteria1 = n.GetStringValue(); } }, + { "criteria2", n => { Criteria2 = n.GetStringValue(); } }, + { "oper", n => { Oper = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("criteria1", Criteria1); + writer.WriteStringValue("criteria2", Criteria2); + writer.WriteStringValue("oper", Oper); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs new file mode 100644 index 0000000000..45b2ddbd9c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyCustomFilter/ApplyCustomFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyCustomFilter +{ + /// + /// Provides operations to call the applyCustomFilter method. + /// + public class ApplyCustomFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyCustomFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyCustomFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyCustomFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyCustomFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyCustomFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyCustomFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyCustomFilter", rawUrl) + { + } + /// + /// Invoke action applyCustomFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyCustomFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyCustomFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterPostRequestBody.cs new file mode 100644 index 0000000000..9f63e59fce --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyDynamicFilter +{ + #pragma warning disable CS1591 + public class ApplyDynamicFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The criteria property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Criteria { get; set; } +#nullable restore +#else + public string Criteria { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyDynamicFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyDynamicFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyDynamicFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "criteria", n => { Criteria = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("criteria", Criteria); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs new file mode 100644 index 0000000000..5c2c5a571b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyDynamicFilter/ApplyDynamicFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyDynamicFilter +{ + /// + /// Provides operations to call the applyDynamicFilter method. + /// + public class ApplyDynamicFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyDynamicFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyDynamicFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyDynamicFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyDynamicFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyDynamicFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyDynamicFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyDynamicFilter", rawUrl) + { + } + /// + /// Invoke action applyDynamicFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyDynamicFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyDynamicFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterPostRequestBody.cs new file mode 100644 index 0000000000..896e60c2c6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyFontColorFilter +{ + #pragma warning disable CS1591 + public class ApplyFontColorFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The color property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Color { get; set; } +#nullable restore +#else + public string Color { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyFontColorFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyFontColorFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyFontColorFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "color", n => { Color = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("color", Color); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs new file mode 100644 index 0000000000..fa3ac05a7f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyFontColorFilter/ApplyFontColorFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyFontColorFilter +{ + /// + /// Provides operations to call the applyFontColorFilter method. + /// + public class ApplyFontColorFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyFontColorFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyFontColorFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyFontColorFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyFontColorFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyFontColorFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyFontColorFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyFontColorFilter", rawUrl) + { + } + /// + /// Invoke action applyFontColorFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyFontColorFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyFontColorFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterPostRequestBody.cs new file mode 100644 index 0000000000..404b52dfd0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyIconFilter +{ + #pragma warning disable CS1591 + public class ApplyIconFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The icon property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public WorkbookIcon? Icon { get; set; } +#nullable restore +#else + public WorkbookIcon Icon { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyIconFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyIconFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyIconFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "icon", n => { Icon = n.GetObjectValue(WorkbookIcon.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("icon", Icon); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs new file mode 100644 index 0000000000..ba15248ca3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyIconFilter/ApplyIconFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyIconFilter +{ + /// + /// Provides operations to call the applyIconFilter method. + /// + public class ApplyIconFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyIconFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyIconFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyIconFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyIconFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyIconFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyIconFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyIconFilter", rawUrl) + { + } + /// + /// Invoke action applyIconFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyIconFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyIconFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterPostRequestBody.cs new file mode 100644 index 0000000000..8e6b1ecfa5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterPostRequestBody.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyTopItemsFilter +{ + #pragma warning disable CS1591 + public class ApplyTopItemsFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The count property + public int? Count { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ApplyTopItemsFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyTopItemsFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyTopItemsFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "count", n => { Count = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("count", Count); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs new file mode 100644 index 0000000000..97991f504f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopItemsFilter/ApplyTopItemsFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyTopItemsFilter +{ + /// + /// Provides operations to call the applyTopItemsFilter method. + /// + public class ApplyTopItemsFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyTopItemsFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyTopItemsFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyTopItemsFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyTopItemsFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyTopItemsFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyTopItemsFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyTopItemsFilter", rawUrl) + { + } + /// + /// Invoke action applyTopItemsFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyTopItemsFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyTopItemsFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterPostRequestBody.cs new file mode 100644 index 0000000000..426406d49b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterPostRequestBody.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyTopPercentFilter +{ + #pragma warning disable CS1591 + public class ApplyTopPercentFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The percent property + public int? Percent { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public ApplyTopPercentFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyTopPercentFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyTopPercentFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "percent", n => { Percent = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("percent", Percent); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs new file mode 100644 index 0000000000..884ef1692c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyTopPercentFilter/ApplyTopPercentFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyTopPercentFilter +{ + /// + /// Provides operations to call the applyTopPercentFilter method. + /// + public class ApplyTopPercentFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyTopPercentFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyTopPercentFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyTopPercentFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyTopPercentFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyTopPercentFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyTopPercentFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyTopPercentFilter", rawUrl) + { + } + /// + /// Invoke action applyTopPercentFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyTopPercentFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyTopPercentFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterPostRequestBody.cs new file mode 100644 index 0000000000..57d232459f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterPostRequestBody.cs @@ -0,0 +1,63 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyValuesFilter +{ + #pragma warning disable CS1591 + public class ApplyValuesFilterPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyValuesFilterPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyValuesFilterPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyValuesFilterPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs new file mode 100644 index 0000000000..5df6759733 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/ApplyValuesFilter/ApplyValuesFilterRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyValuesFilter +{ + /// + /// Provides operations to call the applyValuesFilter method. + /// + public class ApplyValuesFilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action applyValuesFilter + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action applyValuesFilter"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyValuesFilterPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyValuesFilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyValuesFilter", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyValuesFilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/applyValuesFilter", rawUrl) + { + } + /// + /// Invoke action applyValuesFilter + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyValuesFilterPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyValuesFilterPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..fc3187ef07 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/Clear/ClearRequestBuilder.cs @@ -0,0 +1,110 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clear the filter on the given column. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clear the filter on the given column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/filter-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter/clear", rawUrl) + { + } + /// + /// Clear the filter on the given column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs new file mode 100644 index 0000000000..c714116601 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/Filter/FilterRequestBuilder.cs @@ -0,0 +1,550 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.Apply; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyBottomItemsFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyBottomPercentFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyCellColorFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyCustomFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyDynamicFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyFontColorFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyIconFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyTopItemsFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyTopPercentFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.ApplyValuesFilter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter.Clear; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter +{ + /// + /// Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity. + /// + public class FilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the applyBottomItemsFilter method. + /// + /// A + public Command BuildApplyBottomItemsFilterNavCommand() + { + var command = new Command("apply-bottom-items-filter"); + command.Description = "Provides operations to call the applyBottomItemsFilter method."; + var builder = new ApplyBottomItemsFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyBottomPercentFilter method. + /// + /// A + public Command BuildApplyBottomPercentFilterNavCommand() + { + var command = new Command("apply-bottom-percent-filter"); + command.Description = "Provides operations to call the applyBottomPercentFilter method."; + var builder = new ApplyBottomPercentFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyCellColorFilter method. + /// + /// A + public Command BuildApplyCellColorFilterNavCommand() + { + var command = new Command("apply-cell-color-filter"); + command.Description = "Provides operations to call the applyCellColorFilter method."; + var builder = new ApplyCellColorFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyCustomFilter method. + /// + /// A + public Command BuildApplyCustomFilterNavCommand() + { + var command = new Command("apply-custom-filter"); + command.Description = "Provides operations to call the applyCustomFilter method."; + var builder = new ApplyCustomFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyDynamicFilter method. + /// + /// A + public Command BuildApplyDynamicFilterNavCommand() + { + var command = new Command("apply-dynamic-filter"); + command.Description = "Provides operations to call the applyDynamicFilter method."; + var builder = new ApplyDynamicFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyFontColorFilter method. + /// + /// A + public Command BuildApplyFontColorFilterNavCommand() + { + var command = new Command("apply-font-color-filter"); + command.Description = "Provides operations to call the applyFontColorFilter method."; + var builder = new ApplyFontColorFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyIconFilter method. + /// + /// A + public Command BuildApplyIconFilterNavCommand() + { + var command = new Command("apply-icon-filter"); + command.Description = "Provides operations to call the applyIconFilter method."; + var builder = new ApplyIconFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the apply method. + /// + /// A + public Command BuildApplyNavCommand() + { + var command = new Command("apply"); + command.Description = "Provides operations to call the apply method."; + var builder = new ApplyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyTopItemsFilter method. + /// + /// A + public Command BuildApplyTopItemsFilterNavCommand() + { + var command = new Command("apply-top-items-filter"); + command.Description = "Provides operations to call the applyTopItemsFilter method."; + var builder = new ApplyTopItemsFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyTopPercentFilter method. + /// + /// A + public Command BuildApplyTopPercentFilterNavCommand() + { + var command = new Command("apply-top-percent-filter"); + command.Description = "Provides operations to call the applyTopPercentFilter method."; + var builder = new ApplyTopPercentFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the applyValuesFilter method. + /// + /// A + public Command BuildApplyValuesFilterNavCommand() + { + var command = new Command("apply-values-filter"); + command.Description = "Provides operations to call the applyValuesFilter method."; + var builder = new ApplyValuesFilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property filter for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property filter for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Retrieve the filter applied to the column. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property filter in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property filter in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookFilter.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/filter{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property filter for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property filter in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookFilter body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookFilter body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + public class FilterRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..6cf6f85e6a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.HeaderRowRange +{ + /// + /// Provides operations to call the headerRowRange method. + /// + public class HeaderRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the header row of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the header row of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-headerrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HeaderRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/headerRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HeaderRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/headerRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the header row of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..75b1678af1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the entire column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the entire column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/range()", rawUrl) + { + } + /// + /// Gets the range object associated with the entire column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..d8842fcffe --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.TotalRowRange +{ + /// + /// Provides operations to call the totalRowRange method. + /// + public class TotalRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the totals row of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the totals row of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-totalrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TotalRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/totalRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TotalRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}/totalRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the totals row of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/WorkbookTableColumnItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/WorkbookTableColumnItemRequestBuilder.cs new file mode 100644 index 0000000000..e332a366fa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/Item/WorkbookTableColumnItemRequestBuilder.cs @@ -0,0 +1,443 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.DataBodyRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.Filter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.HeaderRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item.TotalRowRange; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.Item +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + public class WorkbookTableColumnItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the dataBodyRange method. + /// + /// A + public Command BuildDataBodyRangeNavCommand() + { + var command = new Command("data-body-range"); + command.Description = "Provides operations to call the dataBodyRange method."; + var builder = new DataBodyRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property columns for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity. + /// + /// A + public Command BuildFilterNavCommand() + { + var command = new Command("filter"); + command.Description = "Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity."; + var builder = new FilterRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildApplyBottomItemsFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyBottomPercentFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyCellColorFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyCustomFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyDynamicFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyFontColorFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyIconFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyNavCommand()); + nonExecCommands.Add(builder.BuildApplyTopItemsFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyTopPercentFilterNavCommand()); + nonExecCommands.Add(builder.BuildApplyValuesFilterNavCommand()); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all the columns in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the headerRowRange method. + /// + /// A + public Command BuildHeaderRowRangeNavCommand() + { + var command = new Command("header-row-range"); + command.Description = "Provides operations to call the headerRowRange method."; + var builder = new HeaderRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property columns in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property columns in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableColumnIdOption = new Option("--workbook-table-column-id", description: "The unique identifier of workbookTableColumn") { + }; + workbookTableColumnIdOption.IsRequired = true; + command.AddOption(workbookTableColumnIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableColumnId = invocationContext.ParseResult.GetValueForOption(workbookTableColumnIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableColumn.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableColumnId is not null) requestInfo.PathParameters.Add("workbookTableColumn%2Did", workbookTableColumnId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the totalRowRange method. + /// + /// A + public Command BuildTotalRowRangeNavCommand() + { + var command = new Command("total-row-range"); + command.Description = "Provides operations to call the totalRowRange method."; + var builder = new TotalRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookTableColumnItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookTableColumnItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/{workbookTableColumn%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property columns for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property columns in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTableColumn body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTableColumn body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + public class WorkbookTableColumnItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs new file mode 100644 index 0000000000..6f4e8eb540 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.DataBodyRange +{ + /// + /// Provides operations to call the dataBodyRange method. + /// + public class DataBodyRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the data body of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the data body of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-databodyrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataBodyRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/dataBodyRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataBodyRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/dataBodyRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the data body of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/Filter/FilterRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/Filter/FilterRequestBuilder.cs new file mode 100644 index 0000000000..a0a1307e9f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/Filter/FilterRequestBuilder.cs @@ -0,0 +1,334 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.Filter +{ + /// + /// Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity. + /// + public class FilterRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property filter for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property filter for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Retrieve the filter applied to the column. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property filter in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property filter in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookFilter.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FilterRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/filter{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FilterRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/filter{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property filter for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property filter in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookFilter body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookFilter body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Retrieve the filter applied to the column. Read-only. + /// + public class FilterRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..b97a35ce76 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.HeaderRowRange +{ + /// + /// Provides operations to call the headerRowRange method. + /// + public class HeaderRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the header row of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the header row of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-headerrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HeaderRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/headerRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HeaderRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/headerRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the header row of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs new file mode 100644 index 0000000000..f1b891c686 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -0,0 +1,213 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.DataBodyRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.Filter; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.HeaderRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.TotalRowRange; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex +{ + /// + /// Provides operations to call the itemAt method. + /// + public class ItemAtWithIndexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the dataBodyRange method. + /// + /// A + public Command BuildDataBodyRangeNavCommand() + { + var command = new Command("data-body-range"); + command.Description = "Provides operations to call the dataBodyRange method."; + var builder = new DataBodyRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity. + /// + /// A + public Command BuildFilterNavCommand() + { + var command = new Command("filter"); + command.Description = "Provides operations to manage the filter property of the microsoft.graph.workbookTableColumn entity."; + var builder = new FilterRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Gets a column based on its position in the collection. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets a column based on its position in the collection.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumncollection-itemat?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the headerRowRange method. + /// + /// A + public Command BuildHeaderRowRangeNavCommand() + { + var command = new Command("header-row-range"); + command.Description = "Provides operations to call the headerRowRange method."; + var builder = new HeaderRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the totalRowRange method. + /// + /// A + public Command BuildTotalRowRangeNavCommand() + { + var command = new Command("total-row-range"); + command.Description = "Provides operations to call the totalRowRange method."; + var builder = new TotalRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemAtWithIndexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemAtWithIndexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})", rawUrl) + { + } + /// + /// Gets a column based on its position in the collection. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..b6f085a8c4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the entire column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the entire column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/range()", rawUrl) + { + } + /// + /// Gets the range object associated with the entire column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..c9f31a0a89 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Columns/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns.ItemAtWithIndex.TotalRowRange +{ + /// + /// Provides operations to call the totalRowRange method. + /// + public class TotalRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the totals row of the column. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the totals row of the column.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablecolumn-totalrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TotalRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/totalRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TotalRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/columns/itemAt(index={index})/totalRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the totals row of the column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs new file mode 100644 index 0000000000..25ac4a2daa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/ConvertToRange/ConvertToRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.ConvertToRange +{ + /// + /// Provides operations to call the convertToRange method. + /// + public class ConvertToRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Converts the table into a normal range of cells. All data is preserved. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Converts the table into a normal range of cells. All data is preserved.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-converttorange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ConvertToRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/convertToRange", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ConvertToRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/convertToRange", rawUrl) + { + } + /// + /// Converts the table into a normal range of cells. All data is preserved. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs new file mode 100644 index 0000000000..2c6cdad456 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.DataBodyRange +{ + /// + /// Provides operations to call the dataBodyRange method. + /// + public class DataBodyRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the data body of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the data body of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-databodyrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataBodyRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/dataBodyRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataBodyRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/dataBodyRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the data body of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..f137f5f7b0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.HeaderRowRange +{ + /// + /// Provides operations to call the headerRowRange method. + /// + public class HeaderRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with header row of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with header row of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-headerrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HeaderRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/headerRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HeaderRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/headerRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with header row of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..faa2a1bbc0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the range object associated with the entire table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the range object associated with the entire table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/range()", rawUrl) + { + } + /// + /// Get the range object associated with the entire table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs new file mode 100644 index 0000000000..b0fc372d35 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/ReapplyFilters/ReapplyFiltersRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.ReapplyFilters +{ + /// + /// Provides operations to call the reapplyFilters method. + /// + public class ReapplyFiltersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Reapplies all the filters currently on the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Reapplies all the filters currently on the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-reapplyfilters?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReapplyFiltersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/reapplyFilters", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReapplyFiltersRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/reapplyFilters", rawUrl) + { + } + /// + /// Reapplies all the filters currently on the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Add/AddPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Add/AddPostRequestBody.cs new file mode 100644 index 0000000000..4b5e7f89fe --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Add/AddPostRequestBody.cs @@ -0,0 +1,67 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Add +{ + #pragma warning disable CS1591 + public class AddPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The index property + public int? Index { get; set; } + /// The values property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Json? Values { get; set; } +#nullable restore +#else + public Json Values { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "index", n => { Index = n.GetIntValue(); } }, + { "values", n => { Values = n.GetObjectValue(Json.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("index", Index); + writer.WriteObjectValue("values", Values); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Add/AddRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Add/AddRequestBuilder.cs new file mode 100644 index 0000000000..65e7ac5b44 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Add/AddRequestBuilder.cs @@ -0,0 +1,130 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Add +{ + /// + /// Provides operations to call the add method. + /// + public class AddRequestBuilder : BaseCliRequestBuilder + { + /// + /// Adds rows to the end of the table. Note that the API can accept multiple rows data using this API. Adding one row at a time could lead to performance degradation. The recommended approach would be to batch the rows together in a single call rather than doing single row insertion. For best results, collect the rows to be inserted on the application side and perform single rows add operation. Experiment with the number of rows to determine the ideal number of rows to use in single API call. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Adds rows to the end of the table. Note that the API can accept multiple rows data using this API. Adding one row at a time could lead to performance degradation. The recommended approach would be to batch the rows together in a single call rather than doing single row insertion. For best results, collect the rows to be inserted on the application side and perform single rows add operation. Experiment with the number of rows to determine the ideal number of rows to use in single API call. \n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablerowcollection-add?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/add", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/add", rawUrl) + { + } + /// + /// Adds rows to the end of the table. Note that the API can accept multiple rows data using this API. Adding one row at a time could lead to performance degradation. The recommended approach would be to batch the rows together in a single call rather than doing single row insertion. For best results, collect the rows to be inserted on the application side and perform single rows add operation. Experiment with the number of rows to determine the ideal number of rows to use in single API call. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountGetResponse.cs new file mode 100644 index 0000000000..720f0c28bf --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Count +{ + #pragma warning disable CS1591 + public class CountGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public int? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public CountGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CountGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..83e777be50 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Count/CountRequestBuilder.cs @@ -0,0 +1,113 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Count +{ + /// + /// Provides operations to call the count method. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function count + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function count"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/count()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/count()", rawUrl) + { + } + /// + /// Invoke function count + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..0204d91fb3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,120 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Item.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function range + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function range"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbook-table-row-id", description: "The unique identifier of workbookTableRow") { + }; + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableRowId = invocationContext.ParseResult.GetValueForOption(workbookTableRowIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableRowId is not null) requestInfo.PathParameters.Add("workbookTableRow%2Did", workbookTableRowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/{workbookTableRow%2Did}/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/{workbookTableRow%2Did}/range()", rawUrl) + { + } + /// + /// Invoke function range + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/WorkbookTableRowItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/WorkbookTableRowItemRequestBuilder.cs new file mode 100644 index 0000000000..7a497af541 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/Item/WorkbookTableRowItemRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Item.RangeNamespace; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Item +{ + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + public class WorkbookTableRowItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property rows for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property rows for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbook-table-row-id", description: "The unique identifier of workbookTableRow") { + }; + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableRowId = invocationContext.ParseResult.GetValueForOption(workbookTableRowIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableRowId is not null) requestInfo.PathParameters.Add("workbookTableRow%2Did", workbookTableRowId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all the rows in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbook-table-row-id", description: "The unique identifier of workbookTableRow") { + }; + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableRowId = invocationContext.ParseResult.GetValueForOption(workbookTableRowIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableRowId is not null) requestInfo.PathParameters.Add("workbookTableRow%2Did", workbookTableRowId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property rows in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property rows in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var workbookTableRowIdOption = new Option("--workbook-table-row-id", description: "The unique identifier of workbookTableRow") { + }; + workbookTableRowIdOption.IsRequired = true; + command.AddOption(workbookTableRowIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var workbookTableRowId = invocationContext.ParseResult.GetValueForOption(workbookTableRowIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableRow.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (workbookTableRowId is not null) requestInfo.PathParameters.Add("workbookTableRow%2Did", workbookTableRowId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookTableRowItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/{workbookTableRow%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookTableRowItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/{workbookTableRow%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property rows for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property rows in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTableRow body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTableRow body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + public class WorkbookTableRowItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs new file mode 100644 index 0000000000..2b63491a46 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -0,0 +1,139 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.ItemAtWithIndex.RangeNamespace; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.ItemAtWithIndex +{ + /// + /// Provides operations to call the itemAt method. + /// + public class ItemAtWithIndexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets a row based on its position in the collection. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets a row based on its position in the collection.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablerowcollection-itemat?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemAtWithIndexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/itemAt(index={index})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemAtWithIndexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/itemAt(index={index})", rawUrl) + { + } + /// + /// Gets a row based on its position in the collection. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..02daa9da20 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,120 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.ItemAtWithIndex.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function range + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function range"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/itemAt(index={index})/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows/itemAt(index={index})/range()", rawUrl) + { + } + /// + /// Invoke function range + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/RowsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/RowsRequestBuilder.cs new file mode 100644 index 0000000000..b3a921ac17 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Rows/RowsRequestBuilder.cs @@ -0,0 +1,409 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows.ItemAtWithIndex; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows +{ + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + public class RowsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookTableRowItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRangeNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to rows for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to rows for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableRow.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the itemAt method. + /// + /// A + public Command BuildItemAtWithIndexRbCommand() + { + var command = new Command("item-at-with-index"); + command.Description = "Provides operations to call the itemAt method."; + var builder = new ItemAtWithIndexRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildRangeNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents a collection of all the rows in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RowsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RowsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/rows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to rows for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTableRow body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTableRow body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + public class RowsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyPostRequestBody.cs new file mode 100644 index 0000000000..892b5e7d09 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyPostRequestBody.cs @@ -0,0 +1,77 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Sort.Apply +{ + #pragma warning disable CS1591 + public class ApplyPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The fields property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Fields { get; set; } +#nullable restore +#else + public List Fields { get; set; } +#endif + /// The matchCase property + public bool? MatchCase { get; set; } + /// The method property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Method { get; set; } +#nullable restore +#else + public string Method { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ApplyPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static ApplyPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ApplyPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "fields", n => { Fields = n.GetCollectionOfObjectValues(WorkbookSortField.CreateFromDiscriminatorValue)?.ToList(); } }, + { "matchCase", n => { MatchCase = n.GetBoolValue(); } }, + { "method", n => { Method = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("fields", Fields); + writer.WriteBoolValue("matchCase", MatchCase); + writer.WriteStringValue("method", Method); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs new file mode 100644 index 0000000000..5d0944420d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Apply/ApplyRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Sort.Apply +{ + /// + /// Provides operations to call the apply method. + /// + public class ApplyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Perform a sort operation. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Perform a sort operation.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablesort-apply?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApplyPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ApplyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/sort/apply", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ApplyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/sort/apply", rawUrl) + { + } + /// + /// Perform a sort operation. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApplyPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApplyPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Clear/ClearRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Clear/ClearRequestBuilder.cs new file mode 100644 index 0000000000..3ecead32d5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Clear/ClearRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Sort.Clear +{ + /// + /// Provides operations to call the clear method. + /// + public class ClearRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clears the sorting that is currently on the table. While this doesn't modify the table's ordering, it clears the state of the header buttons. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clears the sorting that is currently on the table. While this doesn't modify the table's ordering, it clears the state of the header buttons.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablesort-clear?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/sort/clear", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/sort/clear", rawUrl) + { + } + /// + /// Clears the sorting that is currently on the table. While this doesn't modify the table's ordering, it clears the state of the header buttons. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs new file mode 100644 index 0000000000..3ca49befd0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/Reapply/ReapplyRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Sort.Reapply +{ + /// + /// Provides operations to call the reapply method. + /// + public class ReapplyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Reapplies the current sorting parameters to the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Reapplies the current sorting parameters to the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tablesort-reapply?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReapplyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/sort/reapply", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReapplyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/sort/reapply", rawUrl) + { + } + /// + /// Reapplies the current sorting parameters to the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/SortRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/SortRequestBuilder.cs new file mode 100644 index 0000000000..e4d5c75c9b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Sort/SortRequestBuilder.cs @@ -0,0 +1,370 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Sort.Apply; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Sort.Clear; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Sort.Reapply; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Sort +{ + /// + /// Provides operations to manage the sort property of the microsoft.graph.workbookTable entity. + /// + public class SortRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the apply method. + /// + /// A + public Command BuildApplyNavCommand() + { + var command = new Command("apply"); + command.Description = "Provides operations to call the apply method."; + var builder = new ApplyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the clear method. + /// + /// A + public Command BuildClearNavCommand() + { + var command = new Command("clear"); + command.Description = "Provides operations to call the clear method."; + var builder = new ClearRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property sort for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property sort for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the sorting for the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the sorting for the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property sort in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property sort in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableSort.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the reapply method. + /// + /// A + public Command BuildReapplyNavCommand() + { + var command = new Command("reapply"); + command.Description = "Provides operations to call the reapply method."; + var builder = new ReapplyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SortRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/sort{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SortRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/sort{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property sort for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the sorting for the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property sort in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTableSort body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTableSort body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the sorting for the table. Read-only. + /// + public class SortRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..e18052e9e2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.TotalRowRange +{ + /// + /// Provides operations to call the totalRowRange method. + /// + public class TotalRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with totals row of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with totals row of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-totalrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TotalRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/totalRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TotalRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/totalRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with totals row of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/WorkbookTableItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/WorkbookTableItemRequestBuilder.cs new file mode 100644 index 0000000000..d01fe78d79 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/WorkbookTableItemRequestBuilder.cs @@ -0,0 +1,548 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.ClearFilters; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Columns; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.ConvertToRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.DataBodyRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.HeaderRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.ReapplyFilters; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Rows; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Sort; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.TotalRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item +{ + /// + /// Provides operations to manage the tables property of the microsoft.graph.workbookWorksheet entity. + /// + public class WorkbookTableItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clearFilters method. + /// + /// A + public Command BuildClearFiltersNavCommand() + { + var command = new Command("clear-filters"); + command.Description = "Provides operations to call the clearFilters method."; + var builder = new ClearFiltersRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildColumnsNavCommand() + { + var command = new Command("columns"); + command.Description = "Provides operations to manage the columns property of the microsoft.graph.workbookTable entity."; + var builder = new ColumnsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildItemAtWithIndexRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the convertToRange method. + /// + /// A + public Command BuildConvertToRangeNavCommand() + { + var command = new Command("convert-to-range"); + command.Description = "Provides operations to call the convertToRange method."; + var builder = new ConvertToRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dataBodyRange method. + /// + /// A + public Command BuildDataBodyRangeNavCommand() + { + var command = new Command("data-body-range"); + command.Description = "Provides operations to call the dataBodyRange method."; + var builder = new DataBodyRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property tables for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property tables for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Collection of tables that are part of the worksheet. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Collection of tables that are part of the worksheet. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the headerRowRange method. + /// + /// A + public Command BuildHeaderRowRangeNavCommand() + { + var command = new Command("header-row-range"); + command.Description = "Provides operations to call the headerRowRange method."; + var builder = new HeaderRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property tables in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property tables in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTable.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the reapplyFilters method. + /// + /// A + public Command BuildReapplyFiltersNavCommand() + { + var command = new Command("reapply-filters"); + command.Description = "Provides operations to call the reapplyFilters method."; + var builder = new ReapplyFiltersRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildRowsNavCommand() + { + var command = new Command("rows"); + command.Description = "Provides operations to manage the rows property of the microsoft.graph.workbookTable entity."; + var builder = new RowsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildItemAtWithIndexRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the sort property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildSortNavCommand() + { + var command = new Command("sort"); + command.Description = "Provides operations to manage the sort property of the microsoft.graph.workbookTable entity."; + var builder = new SortRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildApplyNavCommand()); + nonExecCommands.Add(builder.BuildClearNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildReapplyNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the totalRowRange method. + /// + /// A + public Command BuildTotalRowRangeNavCommand() + { + var command = new Command("total-row-range"); + command.Description = "Provides operations to call the totalRowRange method."; + var builder = new TotalRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookTableItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookTableItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property tables for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of tables that are part of the worksheet. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property tables in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTable body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTable body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of tables that are part of the worksheet. Read-only. + /// + public class WorkbookTableItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..b0a68c3106 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/Item/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,154 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// The worksheet containing the current table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The worksheet containing the current table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var workbookTableIdOption = new Option("--workbook-table-id", description: "The unique identifier of workbookTable") { + }; + workbookTableIdOption.IsRequired = true; + command.AddOption(workbookTableIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var workbookTableId = invocationContext.ParseResult.GetValueForOption(workbookTableIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (workbookTableId is not null) requestInfo.PathParameters.Add("workbookTable%2Did", workbookTableId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/{workbookTable%2Did}/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// The worksheet containing the current table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The worksheet containing the current table. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ClearFilters/ClearFiltersRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ClearFilters/ClearFiltersRequestBuilder.cs new file mode 100644 index 0000000000..83c665cea3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ClearFilters/ClearFiltersRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.ClearFilters +{ + /// + /// Provides operations to call the clearFilters method. + /// + public class ClearFiltersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Clears all the filters currently applied on the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Clears all the filters currently applied on the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-clearfilters?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ClearFiltersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/clearFilters", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ClearFiltersRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/clearFilters", rawUrl) + { + } + /// + /// Clears all the filters currently applied on the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Columns/ColumnsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Columns/ColumnsRequestBuilder.cs new file mode 100644 index 0000000000..4eca224224 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Columns/ColumnsRequestBuilder.cs @@ -0,0 +1,333 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.Columns +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + public class ColumnsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all the columns in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Create new navigation property to columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableColumn.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTableColumn body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTableColumn body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the columns in the table. Read-only. + /// + public class ColumnsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ConvertToRange/ConvertToRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ConvertToRange/ConvertToRangeRequestBuilder.cs new file mode 100644 index 0000000000..af8b862ad1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ConvertToRange/ConvertToRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.ConvertToRange +{ + /// + /// Provides operations to call the convertToRange method. + /// + public class ConvertToRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Converts the table into a normal range of cells. All data is preserved. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Converts the table into a normal range of cells. All data is preserved.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-converttorange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ConvertToRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/convertToRange", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ConvertToRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/convertToRange", rawUrl) + { + } + /// + /// Converts the table into a normal range of cells. All data is preserved. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs new file mode 100644 index 0000000000..1cf2b3def4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/DataBodyRange/DataBodyRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.DataBodyRange +{ + /// + /// Provides operations to call the dataBodyRange method. + /// + public class DataBodyRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with the data body of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with the data body of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-databodyrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DataBodyRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/dataBodyRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DataBodyRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/dataBodyRange()", rawUrl) + { + } + /// + /// Gets the range object associated with the data body of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..502c923b4e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/HeaderRowRange/HeaderRowRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.HeaderRowRange +{ + /// + /// Provides operations to call the headerRowRange method. + /// + public class HeaderRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with header row of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with header row of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-headerrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public HeaderRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/headerRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public HeaderRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/headerRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with header row of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs new file mode 100644 index 0000000000..e6f25db983 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ItemAtWithIndexRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.ClearFilters; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.Columns; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.ConvertToRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.DataBodyRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.HeaderRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.ReapplyFilters; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.Rows; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.Sort; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.TotalRowRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.Worksheet; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex +{ + /// + /// Provides operations to call the itemAt method. + /// + public class ItemAtWithIndexRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the clearFilters method. + /// + /// A + public Command BuildClearFiltersNavCommand() + { + var command = new Command("clear-filters"); + command.Description = "Provides operations to call the clearFilters method."; + var builder = new ClearFiltersRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the columns property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildColumnsNavCommand() + { + var command = new Command("columns"); + command.Description = "Provides operations to manage the columns property of the microsoft.graph.workbookTable entity."; + var builder = new ColumnsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the convertToRange method. + /// + /// A + public Command BuildConvertToRangeNavCommand() + { + var command = new Command("convert-to-range"); + command.Description = "Provides operations to call the convertToRange method."; + var builder = new ConvertToRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the dataBodyRange method. + /// + /// A + public Command BuildDataBodyRangeNavCommand() + { + var command = new Command("data-body-range"); + command.Description = "Provides operations to call the dataBodyRange method."; + var builder = new DataBodyRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Invoke function itemAt + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function itemAt"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the headerRowRange method. + /// + /// A + public Command BuildHeaderRowRangeNavCommand() + { + var command = new Command("header-row-range"); + command.Description = "Provides operations to call the headerRowRange method."; + var builder = new HeaderRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the reapplyFilters method. + /// + /// A + public Command BuildReapplyFiltersNavCommand() + { + var command = new Command("reapply-filters"); + command.Description = "Provides operations to call the reapplyFilters method."; + var builder = new ReapplyFiltersRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildRowsNavCommand() + { + var command = new Command("rows"); + command.Description = "Provides operations to manage the rows property of the microsoft.graph.workbookTable entity."; + var builder = new RowsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the sort property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildSortNavCommand() + { + var command = new Command("sort"); + command.Description = "Provides operations to manage the sort property of the microsoft.graph.workbookTable entity."; + var builder = new SortRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the totalRowRange method. + /// + /// A + public Command BuildTotalRowRangeNavCommand() + { + var command = new Command("total-row-range"); + command.Description = "Provides operations to call the totalRowRange method."; + var builder = new TotalRowRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity. + /// + /// A + public Command BuildWorksheetNavCommand() + { + var command = new Command("worksheet"); + command.Description = "Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity."; + var builder = new WorksheetRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemAtWithIndexRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemAtWithIndexRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})", rawUrl) + { + } + /// + /// Invoke function itemAt + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs new file mode 100644 index 0000000000..485a16c13b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/RangeNamespace/RangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.RangeNamespace +{ + /// + /// Provides operations to call the range method. + /// + public class RangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the range object associated with the entire table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the range object associated with the entire table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-range?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/range()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/range()", rawUrl) + { + } + /// + /// Get the range object associated with the entire table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ReapplyFilters/ReapplyFiltersRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ReapplyFilters/ReapplyFiltersRequestBuilder.cs new file mode 100644 index 0000000000..3737e211c8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/ReapplyFilters/ReapplyFiltersRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.ReapplyFilters +{ + /// + /// Provides operations to call the reapplyFilters method. + /// + public class ReapplyFiltersRequestBuilder : BaseCliRequestBuilder + { + /// + /// Reapplies all the filters currently on the table. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Reapplies all the filters currently on the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-reapplyfilters?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReapplyFiltersRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/reapplyFilters", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReapplyFiltersRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/reapplyFilters", rawUrl) + { + } + /// + /// Reapplies all the filters currently on the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Rows/RowsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Rows/RowsRequestBuilder.cs new file mode 100644 index 0000000000..418ff238c6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Rows/RowsRequestBuilder.cs @@ -0,0 +1,333 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.Rows +{ + /// + /// Provides operations to manage the rows property of the microsoft.graph.workbookTable entity. + /// + public class RowsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of all the rows in the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Create new navigation property to rows for storage + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Create new navigation property to rows for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableRow.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RowsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/rows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RowsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/rows{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to rows for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTableRow body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTableRow body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of all the rows in the table. Read-only. + /// + public class RowsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Sort/SortRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Sort/SortRequestBuilder.cs new file mode 100644 index 0000000000..534edd1c61 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Sort/SortRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.Sort +{ + /// + /// Provides operations to manage the sort property of the microsoft.graph.workbookTable entity. + /// + public class SortRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property sort for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property sort for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents the sorting for the table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents the sorting for the table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property sort in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property sort in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTableSort.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SortRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/sort{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SortRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/sort{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property sort for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the sorting for the table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property sort in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookTableSort body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookTableSort body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents the sorting for the table. Read-only. + /// + public class SortRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs new file mode 100644 index 0000000000..1751a70ae5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/TotalRowRange/TotalRowRangeRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.TotalRowRange +{ + /// + /// Provides operations to call the totalRowRange method. + /// + public class TotalRowRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Gets the range object associated with totals row of the table. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Gets the range object associated with totals row of the table.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/table-totalrowrange?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TotalRowRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/totalRowRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TotalRowRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/totalRowRange()", rawUrl) + { + } + /// + /// Gets the range object associated with totals row of the table. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Worksheet/WorksheetRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Worksheet/WorksheetRequestBuilder.cs new file mode 100644 index 0000000000..8f532cc623 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/ItemAtWithIndex/Worksheet/WorksheetRequestBuilder.cs @@ -0,0 +1,154 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex.Worksheet +{ + /// + /// Provides operations to manage the worksheet property of the microsoft.graph.workbookTable entity. + /// + public class WorksheetRequestBuilder : BaseCliRequestBuilder + { + /// + /// The worksheet containing the current table. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The worksheet containing the current table. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var indexOption = new Option("--index", description: "Usage: index={index}") { + }; + indexOption.IsRequired = true; + command.AddOption(indexOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var index = invocationContext.ParseResult.GetValueForOption(indexOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (index is not null) requestInfo.PathParameters.Add("index", index); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/worksheet{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables/itemAt(index={index})/worksheet{?%24expand,%24select}", rawUrl) + { + } + /// + /// The worksheet containing the current table. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The worksheet containing the current table. Read-only. + /// + public class WorksheetRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/TablesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/TablesRequestBuilder.cs new file mode 100644 index 0000000000..4f618f1022 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/Tables/TablesRequestBuilder.cs @@ -0,0 +1,417 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.Item; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables.ItemAtWithIndex; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables +{ + /// + /// Provides operations to manage the tables property of the microsoft.graph.workbookWorksheet entity. + /// + public class TablesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the tables property of the microsoft.graph.workbookWorksheet entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookTableItemRequestBuilder(PathParameters); + commands.Add(builder.BuildClearFiltersNavCommand()); + commands.Add(builder.BuildColumnsNavCommand()); + commands.Add(builder.BuildConvertToRangeNavCommand()); + commands.Add(builder.BuildDataBodyRangeNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildHeaderRowRangeNavCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRangeNavCommand()); + commands.Add(builder.BuildReapplyFiltersNavCommand()); + commands.Add(builder.BuildRowsNavCommand()); + commands.Add(builder.BuildSortNavCommand()); + commands.Add(builder.BuildTotalRowRangeNavCommand()); + commands.Add(builder.BuildWorksheetNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to call the count method. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to call the count method."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to tables for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to tables for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookTable.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the itemAt method. + /// + /// A + public Command BuildItemAtWithIndexRbCommand() + { + var command = new Command("item-at-with-index"); + command.Description = "Provides operations to call the itemAt method."; + var builder = new ItemAtWithIndexRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildClearFiltersNavCommand()); + nonExecCommands.Add(builder.BuildColumnsNavCommand()); + nonExecCommands.Add(builder.BuildConvertToRangeNavCommand()); + nonExecCommands.Add(builder.BuildDataBodyRangeNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildHeaderRowRangeNavCommand()); + nonExecCommands.Add(builder.BuildRangeNavCommand()); + nonExecCommands.Add(builder.BuildReapplyFiltersNavCommand()); + nonExecCommands.Add(builder.BuildRowsNavCommand()); + nonExecCommands.Add(builder.BuildSortNavCommand()); + nonExecCommands.Add(builder.BuildTotalRowRangeNavCommand()); + nonExecCommands.Add(builder.BuildWorksheetNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Collection of tables that are part of the worksheet. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Collection of tables that are part of the worksheet. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public TablesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public TablesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/tables{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Collection of tables that are part of the worksheet. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to tables for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookTable body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookTable body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of tables that are part of the worksheet. Read-only. + /// + public class TablesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/UsedRange/UsedRangeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/UsedRange/UsedRangeRequestBuilder.cs new file mode 100644 index 0000000000..8661952ee4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/UsedRange/UsedRangeRequestBuilder.cs @@ -0,0 +1,108 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.UsedRange +{ + /// + /// Provides operations to call the usedRange method. + /// + public class UsedRangeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function usedRange + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function usedRange"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public UsedRangeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/usedRange()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public UsedRangeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/usedRange()", rawUrl) + { + } + /// + /// Invoke function usedRange + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs new file mode 100644 index 0000000000..cc4b628cd2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/UsedRangeWithValuesOnly/UsedRangeWithValuesOnlyRequestBuilder.cs @@ -0,0 +1,114 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.UsedRangeWithValuesOnly +{ + /// + /// Provides operations to call the usedRange method. + /// + public class UsedRangeWithValuesOnlyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function usedRange + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function usedRange"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var valuesOnlyOption = new Option("--values-only", description: "Usage: valuesOnly={valuesOnly}") { + }; + valuesOnlyOption.IsRequired = true; + command.AddOption(valuesOnlyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var valuesOnly = invocationContext.ParseResult.GetValueForOption(valuesOnlyOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (valuesOnly is not null) requestInfo.PathParameters.Add("valuesOnly", valuesOnly); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public UsedRangeWithValuesOnlyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/usedRange(valuesOnly={valuesOnly})", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public UsedRangeWithValuesOnlyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}/usedRange(valuesOnly={valuesOnly})", rawUrl) + { + } + /// + /// Invoke function usedRange + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/WorkbookWorksheetItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/WorkbookWorksheetItemRequestBuilder.cs new file mode 100644 index 0000000000..c472a8e5a1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/Item/WorkbookWorksheetItemRequestBuilder.cs @@ -0,0 +1,535 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.CellWithRowWithColumn; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Charts; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Names; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.PivotTables; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Protection; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.RangeNamespace; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.RangeWithAddress; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.Tables; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.UsedRange; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item.UsedRangeWithValuesOnly; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item +{ + /// + /// Provides operations to manage the worksheets property of the microsoft.graph.workbook entity. + /// + public class WorkbookWorksheetItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the cell method. + /// + /// A + public Command BuildCellWithRowWithColumnRbCommand() + { + var command = new Command("cell-with-row-with-column"); + command.Description = "Provides operations to call the cell method."; + var builder = new CellWithRowWithColumnRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the charts property of the microsoft.graph.workbookWorksheet entity. + /// + /// A + public Command BuildChartsNavCommand() + { + var command = new Command("charts"); + command.Description = "Provides operations to manage the charts property of the microsoft.graph.workbookWorksheet entity."; + var builder = new ChartsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildItemAtWithIndexRbCommand()); + nonExecCommands.Add(builder.BuildItemWithNameRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property worksheets for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property worksheets for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Represents a collection of worksheets associated with the workbook. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Represents a collection of worksheets associated with the workbook. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the names property of the microsoft.graph.workbookWorksheet entity. + /// + /// A + public Command BuildNamesNavCommand() + { + var command = new Command("names"); + command.Description = "Provides operations to manage the names property of the microsoft.graph.workbookWorksheet entity."; + var builder = new NamesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddFormulaLocalNavCommand()); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property worksheets in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property worksheets in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var workbookWorksheetIdOption = new Option("--workbook-worksheet-id", description: "The unique identifier of workbookWorksheet") { + }; + workbookWorksheetIdOption.IsRequired = true; + command.AddOption(workbookWorksheetIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var workbookWorksheetId = invocationContext.ParseResult.GetValueForOption(workbookWorksheetIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookWorksheet.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (workbookWorksheetId is not null) requestInfo.PathParameters.Add("workbookWorksheet%2Did", workbookWorksheetId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the pivotTables property of the microsoft.graph.workbookWorksheet entity. + /// + /// A + public Command BuildPivotTablesNavCommand() + { + var command = new Command("pivot-tables"); + command.Description = "Provides operations to manage the pivotTables property of the microsoft.graph.workbookWorksheet entity."; + var builder = new PivotTablesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + nonExecCommands.Add(builder.BuildRefreshAllNavCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the protection property of the microsoft.graph.workbookWorksheet entity. + /// + /// A + public Command BuildProtectionNavCommand() + { + var command = new Command("protection"); + command.Description = "Provides operations to manage the protection property of the microsoft.graph.workbookWorksheet entity."; + var builder = new ProtectionRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildProtectNavCommand()); + nonExecCommands.Add(builder.BuildUnprotectNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeNavCommand() + { + var command = new Command("range"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the range method. + /// + /// A + public Command BuildRangeWithAddressRbCommand() + { + var command = new Command("range-with-address"); + command.Description = "Provides operations to call the range method."; + var builder = new RangeWithAddressRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the tables property of the microsoft.graph.workbookWorksheet entity. + /// + /// A + public Command BuildTablesNavCommand() + { + var command = new Command("tables"); + command.Description = "Provides operations to manage the tables property of the microsoft.graph.workbookWorksheet entity."; + var builder = new TablesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildItemAtWithIndexRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the usedRange method. + /// + /// A + public Command BuildUsedRangeNavCommand() + { + var command = new Command("used-range"); + command.Description = "Provides operations to call the usedRange method."; + var builder = new UsedRangeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the usedRange method. + /// + /// A + public Command BuildUsedRangeWithValuesOnlyRbCommand() + { + var command = new Command("used-range-with-values-only"); + command.Description = "Provides operations to call the usedRange method."; + var builder = new UsedRangeWithValuesOnlyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorkbookWorksheetItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorkbookWorksheetItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets/{workbookWorksheet%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property worksheets for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of worksheets associated with the workbook. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property worksheets in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(WorkbookWorksheet body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(WorkbookWorksheet body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of worksheets associated with the workbook. Read-only. + /// + public class WorkbookWorksheetItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/WorksheetsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/WorksheetsRequestBuilder.cs new file mode 100644 index 0000000000..9cff8e5144 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/Item/Workbook/Worksheets/WorksheetsRequestBuilder.cs @@ -0,0 +1,370 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Add; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item.Workbook.Worksheets +{ + /// + /// Provides operations to manage the worksheets property of the microsoft.graph.workbook entity. + /// + public class WorksheetsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the add method. + /// + /// A + public Command BuildAddNavCommand() + { + var command = new Command("add"); + command.Description = "Provides operations to call the add method."; + var builder = new AddRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the worksheets property of the microsoft.graph.workbook entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new WorkbookWorksheetItemRequestBuilder(PathParameters); + commands.Add(builder.BuildCellWithRowWithColumnRbCommand()); + commands.Add(builder.BuildChartsNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildNamesNavCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildPivotTablesNavCommand()); + commands.Add(builder.BuildProtectionNavCommand()); + commands.Add(builder.BuildRangeNavCommand()); + commands.Add(builder.BuildRangeWithAddressRbCommand()); + commands.Add(builder.BuildTablesNavCommand()); + commands.Add(builder.BuildUsedRangeNavCommand()); + commands.Add(builder.BuildUsedRangeWithValuesOnlyRbCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to worksheets for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to worksheets for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(WorkbookWorksheet.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Represents a collection of worksheets associated with the workbook. Read-only. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Represents a collection of worksheets associated with the workbook. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public WorksheetsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public WorksheetsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items/{driveItem%2Did}/workbook/worksheets{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Represents a collection of worksheets associated with the workbook. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to worksheets for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(WorkbookWorksheet body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(WorkbookWorksheet body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Represents a collection of worksheets associated with the workbook. Read-only. + /// + public class WorksheetsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/ItemsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/ItemsRequestBuilder.cs new file mode 100644 index 0000000000..65168d3637 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Items/ItemsRequestBuilder.cs @@ -0,0 +1,361 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Items +{ + /// + /// Provides operations to manage the items property of the microsoft.graph.drive entity. + /// + public class ItemsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the items property of the microsoft.graph.drive entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new DriveItemItemRequestBuilder(PathParameters); + commands.Add(builder.BuildAnalyticsNavCommand()); + commands.Add(builder.BuildAssignSensitivityLabelNavCommand()); + commands.Add(builder.BuildCheckinNavCommand()); + commands.Add(builder.BuildCheckoutNavCommand()); + commands.Add(builder.BuildChildrenNavCommand()); + commands.Add(builder.BuildContentNavCommand()); + commands.Add(builder.BuildCopyNavCommand()); + commands.Add(builder.BuildCreatedByUserNavCommand()); + commands.Add(builder.BuildCreateLinkNavCommand()); + commands.Add(builder.BuildCreateUploadSessionNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildDeltaNavCommand()); + commands.Add(builder.BuildDeltaWithTokenRbCommand()); + commands.Add(builder.BuildExtractSensitivityLabelsNavCommand()); + commands.Add(builder.BuildFollowNavCommand()); + commands.Add(builder.BuildGetActivitiesByIntervalNavCommand()); + commands.Add(builder.BuildGetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRbCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildInviteNavCommand()); + commands.Add(builder.BuildLastModifiedByUserNavCommand()); + commands.Add(builder.BuildListItemNavCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildPermanentDeleteNavCommand()); + commands.Add(builder.BuildPermissionsNavCommand()); + commands.Add(builder.BuildPreviewNavCommand()); + commands.Add(builder.BuildRestoreNavCommand()); + commands.Add(builder.BuildRetentionLabelNavCommand()); + commands.Add(builder.BuildSearchWithQRbCommand()); + commands.Add(builder.BuildSubscriptionsNavCommand()); + commands.Add(builder.BuildThumbnailsNavCommand()); + commands.Add(builder.BuildUnfollowNavCommand()); + commands.Add(builder.BuildValidatePermissionNavCommand()); + commands.Add(builder.BuildVersionsNavCommand()); + commands.Add(builder.BuildWorkbookNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to items for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to items for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// All items contained in the drive. Read-only. Nullable. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "All items contained in the drive. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/items{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// All items contained in the drive. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to items for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApiSdk.Models.DriveItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApiSdk.Models.DriveItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// All items contained in the drive. Read-only. Nullable. + /// + public class ItemsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs new file mode 100644 index 0000000000..95c32011dc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs @@ -0,0 +1,179 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.LastModifiedByUser.MailboxSettings; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.LastModifiedByUser.ServiceProvisioningErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.LastModifiedByUser +{ + /// + /// Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity. + /// + public class LastModifiedByUserRequestBuilder : BaseCliRequestBuilder + { + /// + /// Identity of the user who last modified the item. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Identity of the user who last modified the item. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The mailboxSettings property + /// + /// A + public Command BuildMailboxSettingsNavCommand() + { + var command = new Command("mailbox-settings"); + command.Description = "The mailboxSettings property"; + var builder = new MailboxSettingsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The serviceProvisioningErrors property + /// + /// A + public Command BuildServiceProvisioningErrorsNavCommand() + { + var command = new Command("service-provisioning-errors"); + command.Description = "The serviceProvisioningErrors property"; + var builder = new ServiceProvisioningErrorsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LastModifiedByUserRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/lastModifiedByUser{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LastModifiedByUserRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/lastModifiedByUser{?%24expand,%24select}", rawUrl) + { + } + /// + /// Identity of the user who last modified the item. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Identity of the user who last modified the item. Read-only. + /// + public class LastModifiedByUserRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs new file mode 100644 index 0000000000..31f37b20df --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs @@ -0,0 +1,208 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.LastModifiedByUser.MailboxSettings +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\lastModifiedByUser\mailboxSettings + /// + public class MailboxSettingsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update property mailboxSettings value. + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update property mailboxSettings value."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.MailboxSettings.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MailboxSettingsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/lastModifiedByUser/mailboxSettings{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MailboxSettingsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/lastModifiedByUser/mailboxSettings{?%24expand,%24select}", rawUrl) + { + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update property mailboxSettings value. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + public class MailboxSettingsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..5d82e9a2c7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.LastModifiedByUser.ServiceProvisioningErrors.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/lastModifiedByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/lastModifiedByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs new file mode 100644 index 0000000000..644552c3e2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs @@ -0,0 +1,243 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.LastModifiedByUser.ServiceProvisioningErrors.Count; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.LastModifiedByUser.ServiceProvisioningErrors +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\lastModifiedByUser\serviceProvisioningErrors + /// + public class ServiceProvisioningErrorsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance)."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ServiceProvisioningErrorsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/lastModifiedByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ServiceProvisioningErrorsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/lastModifiedByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + public class ServiceProvisioningErrorsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/ColumnsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/ColumnsRequestBuilder.cs new file mode 100644 index 0000000000..27d91cff14 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/ColumnsRequestBuilder.cs @@ -0,0 +1,331 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Columns.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Columns.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Columns +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.list entity. + /// + public class ColumnsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the columns property of the microsoft.graph.list entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new ColumnDefinitionItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildSourceColumnNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ColumnDefinition.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The collection of field definitions for this list. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The collection of field definitions for this list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The collection of field definitions for this list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ColumnDefinition body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ColumnDefinition body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of field definitions for this list. + /// + public class ColumnsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..717f1a73c6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Columns.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/columns/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/columns/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/Item/ColumnDefinitionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/Item/ColumnDefinitionItemRequestBuilder.cs new file mode 100644 index 0000000000..66958a262f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/Item/ColumnDefinitionItemRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Columns.Item.SourceColumn; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Columns.Item +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.list entity. + /// + public class ColumnDefinitionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property columns for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var columnDefinitionIdOption = new Option("--column-definition-id", description: "The unique identifier of columnDefinition") { + }; + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var columnDefinitionId = invocationContext.ParseResult.GetValueForOption(columnDefinitionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (columnDefinitionId is not null) requestInfo.PathParameters.Add("columnDefinition%2Did", columnDefinitionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The collection of field definitions for this list. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The collection of field definitions for this list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var columnDefinitionIdOption = new Option("--column-definition-id", description: "The unique identifier of columnDefinition") { + }; + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var columnDefinitionId = invocationContext.ParseResult.GetValueForOption(columnDefinitionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (columnDefinitionId is not null) requestInfo.PathParameters.Add("columnDefinition%2Did", columnDefinitionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property columns in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property columns in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var columnDefinitionIdOption = new Option("--column-definition-id", description: "The unique identifier of columnDefinition") { + }; + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var columnDefinitionId = invocationContext.ParseResult.GetValueForOption(columnDefinitionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ColumnDefinition.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (columnDefinitionId is not null) requestInfo.PathParameters.Add("columnDefinition%2Did", columnDefinitionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the sourceColumn property of the microsoft.graph.columnDefinition entity. + /// + /// A + public Command BuildSourceColumnNavCommand() + { + var command = new Command("source-column"); + command.Description = "Provides operations to manage the sourceColumn property of the microsoft.graph.columnDefinition entity."; + var builder = new SourceColumnRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnDefinitionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/columns/{columnDefinition%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnDefinitionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/columns/{columnDefinition%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property columns for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of field definitions for this list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property columns in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ColumnDefinition body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ColumnDefinition body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of field definitions for this list. + /// + public class ColumnDefinitionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs new file mode 100644 index 0000000000..df7cfbe0a0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -0,0 +1,142 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Columns.Item.SourceColumn +{ + /// + /// Provides operations to manage the sourceColumn property of the microsoft.graph.columnDefinition entity. + /// + public class SourceColumnRequestBuilder : BaseCliRequestBuilder + { + /// + /// The source column for the content type column. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The source column for the content type column."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var columnDefinitionIdOption = new Option("--column-definition-id", description: "The unique identifier of columnDefinition") { + }; + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var columnDefinitionId = invocationContext.ParseResult.GetValueForOption(columnDefinitionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (columnDefinitionId is not null) requestInfo.PathParameters.Add("columnDefinition%2Did", columnDefinitionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SourceColumnRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/columns/{columnDefinition%2Did}/sourceColumn{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SourceColumnRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/columns/{columnDefinition%2Did}/sourceColumn{?%24expand,%24select}", rawUrl) + { + } + /// + /// The source column for the content type column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The source column for the content type column. + /// + public class SourceColumnRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopy/AddCopyPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopy/AddCopyPostRequestBody.cs new file mode 100644 index 0000000000..86abf5a413 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopy/AddCopyPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.AddCopy +{ + #pragma warning disable CS1591 + public class AddCopyPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The contentType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ContentType { get; set; } +#nullable restore +#else + public string ContentType { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddCopyPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddCopyPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddCopyPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "contentType", n => { ContentType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("contentType", ContentType); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs new file mode 100644 index 0000000000..6a8fb03d9f --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopy/AddCopyRequestBuilder.cs @@ -0,0 +1,112 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.AddCopy +{ + /// + /// Provides operations to call the addCopy method. + /// + public class AddCopyRequestBuilder : BaseCliRequestBuilder + { + /// + /// Add a copy of a content type from a site to a list. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Add a copy of a content type from a site to a list.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/contenttype-addcopy?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddCopyPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddCopyRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/addCopy", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddCopyRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/addCopy", rawUrl) + { + } + /// + /// Add a copy of a content type from a site to a list. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddCopyPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddCopyPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopyFromContentTypeHub/AddCopyFromContentTypeHubPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopyFromContentTypeHub/AddCopyFromContentTypeHubPostRequestBody.cs new file mode 100644 index 0000000000..c4967f7a88 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopyFromContentTypeHub/AddCopyFromContentTypeHubPostRequestBody.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.AddCopyFromContentTypeHub +{ + #pragma warning disable CS1591 + public class AddCopyFromContentTypeHubPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The contentTypeId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ContentTypeId { get; set; } +#nullable restore +#else + public string ContentTypeId { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AddCopyFromContentTypeHubPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AddCopyFromContentTypeHubPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddCopyFromContentTypeHubPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "contentTypeId", n => { ContentTypeId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("contentTypeId", ContentTypeId); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopyFromContentTypeHub/AddCopyFromContentTypeHubRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopyFromContentTypeHub/AddCopyFromContentTypeHubRequestBuilder.cs new file mode 100644 index 0000000000..d578c48f29 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/AddCopyFromContentTypeHub/AddCopyFromContentTypeHubRequestBuilder.cs @@ -0,0 +1,112 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.AddCopyFromContentTypeHub +{ + /// + /// Provides operations to call the addCopyFromContentTypeHub method. + /// + public class AddCopyFromContentTypeHubRequestBuilder : BaseCliRequestBuilder + { + /// + /// Add or sync a copy of a published content type from the content type hub to a target site or a list. This method is part of the content type publishing changes to optimize the syncing of published content types to sites and lists, effectively switching from a 'push everywhere' to 'pull as needed' approach. The method allows users to pull content types directly from the content type hub to a site or list. For more information, see contentType: getCompatibleHubContentTypes and the blog post Syntex Product Updates – August 2021. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Add or sync a copy of a published content type from the content type hub to a target site or a list. This method is part of the content type publishing changes to optimize the syncing of published content types to sites and lists, effectively switching from a 'push everywhere' to 'pull as needed' approach. The method allows users to pull content types directly from the content type hub to a site or list. For more information, see contentType: getCompatibleHubContentTypes and the blog post Syntex Product Updates – August 2021.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/contenttype-addcopyfromcontenttypehub?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AddCopyFromContentTypeHubPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AddCopyFromContentTypeHubRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/addCopyFromContentTypeHub", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AddCopyFromContentTypeHubRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/addCopyFromContentTypeHub", rawUrl) + { + } + /// + /// Add or sync a copy of a published content type from the content type hub to a target site or a list. This method is part of the content type publishing changes to optimize the syncing of published content types to sites and lists, effectively switching from a 'push everywhere' to 'pull as needed' approach. The method allows users to pull content types directly from the content type hub to a site or list. For more information, see contentType: getCompatibleHubContentTypes and the blog post Syntex Product Updates – August 2021. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddCopyFromContentTypeHubPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddCopyFromContentTypeHubPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/ContentTypesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/ContentTypesRequestBuilder.cs new file mode 100644 index 0000000000..7628c797b3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/ContentTypesRequestBuilder.cs @@ -0,0 +1,394 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.AddCopy; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.AddCopyFromContentTypeHub; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.GetCompatibleHubContentTypes; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes +{ + /// + /// Provides operations to manage the contentTypes property of the microsoft.graph.list entity. + /// + public class ContentTypesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the addCopyFromContentTypeHub method. + /// + /// A + public Command BuildAddCopyFromContentTypeHubNavCommand() + { + var command = new Command("add-copy-from-content-type-hub"); + command.Description = "Provides operations to call the addCopyFromContentTypeHub method."; + var builder = new AddCopyFromContentTypeHubRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the addCopy method. + /// + /// A + public Command BuildAddCopyNavCommand() + { + var command = new Command("add-copy"); + command.Description = "Provides operations to call the addCopy method."; + var builder = new AddCopyRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the contentTypes property of the microsoft.graph.list entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new ContentTypeItemRequestBuilder(PathParameters); + commands.Add(builder.BuildAssociateWithHubSitesNavCommand()); + commands.Add(builder.BuildBaseNavCommand()); + commands.Add(builder.BuildBaseTypesNavCommand()); + commands.Add(builder.BuildColumnLinksNavCommand()); + commands.Add(builder.BuildColumnPositionsNavCommand()); + commands.Add(builder.BuildColumnsNavCommand()); + commands.Add(builder.BuildCopyToDefaultContentLocationNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildIsPublishedNavCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildPublishNavCommand()); + commands.Add(builder.BuildUnpublishNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to contentTypes for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to contentTypes for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ContentType.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the getCompatibleHubContentTypes method. + /// + /// A + public Command BuildGetCompatibleHubContentTypesNavCommand() + { + var command = new Command("get-compatible-hub-content-types"); + command.Description = "Provides operations to call the getCompatibleHubContentTypes method."; + var builder = new GetCompatibleHubContentTypesRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The collection of content types present in this list. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The collection of content types present in this list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentTypesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentTypesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The collection of content types present in this list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to contentTypes for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ContentType body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ContentType body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of content types present in this list. + /// + public class ContentTypesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..9b88d664cb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/GetCompatibleHubContentTypes/GetCompatibleHubContentTypesGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/GetCompatibleHubContentTypes/GetCompatibleHubContentTypesGetResponse.cs new file mode 100644 index 0000000000..578f7defec --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/GetCompatibleHubContentTypes/GetCompatibleHubContentTypesGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.GetCompatibleHubContentTypes +{ + #pragma warning disable CS1591 + public class GetCompatibleHubContentTypesGetResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new GetCompatibleHubContentTypesGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GetCompatibleHubContentTypesGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ContentType.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/GetCompatibleHubContentTypes/GetCompatibleHubContentTypesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/GetCompatibleHubContentTypes/GetCompatibleHubContentTypesRequestBuilder.cs new file mode 100644 index 0000000000..0ba92a9021 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/GetCompatibleHubContentTypes/GetCompatibleHubContentTypesRequestBuilder.cs @@ -0,0 +1,225 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.GetCompatibleHubContentTypes +{ + /// + /// Provides operations to call the getCompatibleHubContentTypes method. + /// + public class GetCompatibleHubContentTypesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get a list of compatible content types from the content type hub that can be added to a target site or a list. This method is part of the content type publishing changes to optimize the syncing of published content types to sites and lists, effectively switching from a 'push everywhere' to 'pull as needed' approach. The method allows users to pull content types directly from the content type hub to a site or list. For more information, see contentType: addCopyFromContentTypeHub and the blog post Syntex Product Updates – August 2021. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get a list of compatible content types from the content type hub that can be added to a target site or a list. This method is part of the content type publishing changes to optimize the syncing of published content types to sites and lists, effectively switching from a 'push everywhere' to 'pull as needed' approach. The method allows users to pull content types directly from the content type hub to a site or list. For more information, see contentType: addCopyFromContentTypeHub and the blog post Syntex Product Updates – August 2021.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/contenttype-getcompatiblehubcontenttypes?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GetCompatibleHubContentTypesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/getCompatibleHubContentTypes(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GetCompatibleHubContentTypesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/getCompatibleHubContentTypes(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get a list of compatible content types from the content type hub that can be added to a target site or a list. This method is part of the content type publishing changes to optimize the syncing of published content types to sites and lists, effectively switching from a 'push everywhere' to 'pull as needed' approach. The method allows users to pull content types directly from the content type hub to a site or list. For more information, see contentType: addCopyFromContentTypeHub and the blog post Syntex Product Updates – August 2021. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get a list of compatible content types from the content type hub that can be added to a target site or a list. This method is part of the content type publishing changes to optimize the syncing of published content types to sites and lists, effectively switching from a 'push everywhere' to 'pull as needed' approach. The method allows users to pull content types directly from the content type hub to a site or list. For more information, see contentType: addCopyFromContentTypeHub and the blog post Syntex Product Updates – August 2021. + /// + public class GetCompatibleHubContentTypesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesPostRequestBody.cs new file mode 100644 index 0000000000..925afc5e15 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesPostRequestBody.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.AssociateWithHubSites +{ + #pragma warning disable CS1591 + public class AssociateWithHubSitesPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The hubSiteUrls property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? HubSiteUrls { get; set; } +#nullable restore +#else + public List HubSiteUrls { get; set; } +#endif + /// The propagateToExistingLists property + public bool? PropagateToExistingLists { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public AssociateWithHubSitesPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static AssociateWithHubSitesPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AssociateWithHubSitesPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "hubSiteUrls", n => { HubSiteUrls = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + { "propagateToExistingLists", n => { PropagateToExistingLists = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("hubSiteUrls", HubSiteUrls); + writer.WriteBoolValue("propagateToExistingLists", PropagateToExistingLists); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs new file mode 100644 index 0000000000..af315c00f5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/AssociateWithHubSites/AssociateWithHubSitesRequestBuilder.cs @@ -0,0 +1,107 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.AssociateWithHubSites +{ + /// + /// Provides operations to call the associateWithHubSites method. + /// + public class AssociateWithHubSitesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Associate a published content type present in a content type hub with a list of hub sites. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Associate a published content type present in a content type hub with a list of hub sites.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/contenttype-associatewithhubsites?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(AssociateWithHubSitesPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AssociateWithHubSitesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/associateWithHubSites", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AssociateWithHubSitesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/associateWithHubSites", rawUrl) + { + } + /// + /// Associate a published content type present in a content type hub with a list of hub sites. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AssociateWithHubSitesPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AssociateWithHubSitesPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Base/BaseRequestBuilderEscaped.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Base/BaseRequestBuilderEscaped.cs new file mode 100644 index 0000000000..94c06f71cd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Base/BaseRequestBuilderEscaped.cs @@ -0,0 +1,142 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Base +{ + /// + /// Provides operations to manage the base property of the microsoft.graph.contentType entity. + /// + public class BaseRequestBuilderEscaped : BaseCliRequestBuilder + { + /// + /// Parent contentType from which this content type is derived. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Parent contentType from which this content type is derived."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BaseRequestBuilderEscaped(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/base{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BaseRequestBuilderEscaped(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/base{?%24expand,%24select}", rawUrl) + { + } + /// + /// Parent contentType from which this content type is derived. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Parent contentType from which this content type is derived. + /// + public class BaseRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs new file mode 100644 index 0000000000..e8cf199d67 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/BaseTypes/BaseTypesRequestBuilder.cs @@ -0,0 +1,261 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.BaseTypes.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.BaseTypes.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.BaseTypes +{ + /// + /// Provides operations to manage the baseTypes property of the microsoft.graph.contentType entity. + /// + public class BaseTypesRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the baseTypes property of the microsoft.graph.contentType entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var builder = new ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.BaseTypes.Item.ContentTypeItemRequestBuilder(PathParameters); + executables.Add(builder.BuildGetCommand()); + return new(executables, new(0)); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The collection of content types that are ancestors of this content type. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The collection of content types that are ancestors of this content type."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public BaseTypesRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/baseTypes{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public BaseTypesRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/baseTypes{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The collection of content types that are ancestors of this content type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of content types that are ancestors of this content type. + /// + public class BaseTypesRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/BaseTypes/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/BaseTypes/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..df6ce2aadc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/BaseTypes/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.BaseTypes.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/baseTypes/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/baseTypes/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/BaseTypes/Item/ContentTypeItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/BaseTypes/Item/ContentTypeItemRequestBuilder.cs new file mode 100644 index 0000000000..085c12c701 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/BaseTypes/Item/ContentTypeItemRequestBuilder.cs @@ -0,0 +1,148 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.BaseTypes.Item +{ + /// + /// Provides operations to manage the baseTypes property of the microsoft.graph.contentType entity. + /// + public class ContentTypeItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// The collection of content types that are ancestors of this content type. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The collection of content types that are ancestors of this content type."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var contentTypeId1Option = new Option("--content-type-id1", description: "The unique identifier of contentType") { + }; + contentTypeId1Option.IsRequired = true; + command.AddOption(contentTypeId1Option); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var contentTypeId1 = invocationContext.ParseResult.GetValueForOption(contentTypeId1Option); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (contentTypeId1 is not null) requestInfo.PathParameters.Add("contentType%2Did1", contentTypeId1); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentTypeItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/baseTypes/{contentType%2Did1}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentTypeItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/baseTypes/{contentType%2Did1}{?%24expand,%24select}", rawUrl) + { + } + /// + /// The collection of content types that are ancestors of this content type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of content types that are ancestors of this content type. + /// + public class ContentTypeItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs new file mode 100644 index 0000000000..35dbf10d55 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnLinks/ColumnLinksRequestBuilder.cs @@ -0,0 +1,341 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnLinks.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnLinks.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnLinks +{ + /// + /// Provides operations to manage the columnLinks property of the microsoft.graph.contentType entity. + /// + public class ColumnLinksRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the columnLinks property of the microsoft.graph.contentType entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var builder = new ColumnLinkItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, new(0)); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to columnLinks for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to columnLinks for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ColumnLink.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The collection of columns that are required by this content type. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The collection of columns that are required by this content type."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnLinksRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnLinks{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnLinksRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnLinks{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The collection of columns that are required by this content type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to columnLinks for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ColumnLink body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ColumnLink body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of columns that are required by this content type. + /// + public class ColumnLinksRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnLinks/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnLinks/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..12d3b64248 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnLinks/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnLinks.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnLinks/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnLinks/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkItemRequestBuilder.cs new file mode 100644 index 0000000000..a0f6d1ef79 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnLinks/Item/ColumnLinkItemRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnLinks.Item +{ + /// + /// Provides operations to manage the columnLinks property of the microsoft.graph.contentType entity. + /// + public class ColumnLinkItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property columnLinks for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property columnLinks for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--column-link-id", description: "The unique identifier of columnLink") { + }; + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var columnLinkId = invocationContext.ParseResult.GetValueForOption(columnLinkIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (columnLinkId is not null) requestInfo.PathParameters.Add("columnLink%2Did", columnLinkId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The collection of columns that are required by this content type. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The collection of columns that are required by this content type."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--column-link-id", description: "The unique identifier of columnLink") { + }; + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var columnLinkId = invocationContext.ParseResult.GetValueForOption(columnLinkIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (columnLinkId is not null) requestInfo.PathParameters.Add("columnLink%2Did", columnLinkId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property columnLinks in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property columnLinks in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnLinkIdOption = new Option("--column-link-id", description: "The unique identifier of columnLink") { + }; + columnLinkIdOption.IsRequired = true; + command.AddOption(columnLinkIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var columnLinkId = invocationContext.ParseResult.GetValueForOption(columnLinkIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ColumnLink.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (columnLinkId is not null) requestInfo.PathParameters.Add("columnLink%2Did", columnLinkId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnLinkItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnLinks/{columnLink%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnLinkItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnLinks/{columnLink%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property columnLinks for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of columns that are required by this content type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property columnLinks in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ColumnLink body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ColumnLink body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of columns that are required by this content type. + /// + public class ColumnLinkItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs new file mode 100644 index 0000000000..e791686928 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnPositions/ColumnPositionsRequestBuilder.cs @@ -0,0 +1,261 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnPositions.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnPositions.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnPositions +{ + /// + /// Provides operations to manage the columnPositions property of the microsoft.graph.contentType entity. + /// + public class ColumnPositionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the columnPositions property of the microsoft.graph.contentType entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var builder = new ColumnDefinitionItemRequestBuilder(PathParameters); + executables.Add(builder.BuildGetCommand()); + return new(executables, new(0)); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Column order information in a content type. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Column order information in a content type."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnPositionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnPositions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnPositionsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnPositions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Column order information in a content type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Column order information in a content type. + /// + public class ColumnPositionsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnPositions/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnPositions/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..b44aa7c78e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnPositions/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnPositions.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnPositions/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnPositions/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnPositions/Item/ColumnDefinitionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnPositions/Item/ColumnDefinitionItemRequestBuilder.cs new file mode 100644 index 0000000000..c25cd98178 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ColumnPositions/Item/ColumnDefinitionItemRequestBuilder.cs @@ -0,0 +1,148 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnPositions.Item +{ + /// + /// Provides operations to manage the columnPositions property of the microsoft.graph.contentType entity. + /// + public class ColumnDefinitionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Column order information in a content type. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Column order information in a content type."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--column-definition-id", description: "The unique identifier of columnDefinition") { + }; + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var columnDefinitionId = invocationContext.ParseResult.GetValueForOption(columnDefinitionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (columnDefinitionId is not null) requestInfo.PathParameters.Add("columnDefinition%2Did", columnDefinitionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnDefinitionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnPositions/{columnDefinition%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnDefinitionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columnPositions/{columnDefinition%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Column order information in a content type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Column order information in a content type. + /// + public class ColumnDefinitionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs new file mode 100644 index 0000000000..ebdd87e1b9 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/ColumnsRequestBuilder.cs @@ -0,0 +1,343 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Columns.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Columns.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Columns +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.contentType entity. + /// + public class ColumnsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the columns property of the microsoft.graph.contentType entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new ColumnDefinitionItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildSourceColumnNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ColumnDefinition.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The collection of column definitions for this content type. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The collection of column definitions for this content type."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The collection of column definitions for this content type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to columns for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ColumnDefinition body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ColumnDefinition body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of column definitions for this content type. + /// + public class ColumnsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..c8f9ec7c7b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Columns.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columns/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columns/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/Item/ColumnDefinitionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/Item/ColumnDefinitionItemRequestBuilder.cs new file mode 100644 index 0000000000..28d4f76c26 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/Item/ColumnDefinitionItemRequestBuilder.cs @@ -0,0 +1,316 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Columns.Item.SourceColumn; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Columns.Item +{ + /// + /// Provides operations to manage the columns property of the microsoft.graph.contentType entity. + /// + public class ColumnDefinitionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property columns for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property columns for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--column-definition-id", description: "The unique identifier of columnDefinition") { + }; + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var columnDefinitionId = invocationContext.ParseResult.GetValueForOption(columnDefinitionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (columnDefinitionId is not null) requestInfo.PathParameters.Add("columnDefinition%2Did", columnDefinitionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The collection of column definitions for this content type. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The collection of column definitions for this content type."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--column-definition-id", description: "The unique identifier of columnDefinition") { + }; + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var columnDefinitionId = invocationContext.ParseResult.GetValueForOption(columnDefinitionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (columnDefinitionId is not null) requestInfo.PathParameters.Add("columnDefinition%2Did", columnDefinitionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property columns in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property columns in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--column-definition-id", description: "The unique identifier of columnDefinition") { + }; + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var columnDefinitionId = invocationContext.ParseResult.GetValueForOption(columnDefinitionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ColumnDefinition.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (columnDefinitionId is not null) requestInfo.PathParameters.Add("columnDefinition%2Did", columnDefinitionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the sourceColumn property of the microsoft.graph.columnDefinition entity. + /// + /// A + public Command BuildSourceColumnNavCommand() + { + var command = new Command("source-column"); + command.Description = "Provides operations to manage the sourceColumn property of the microsoft.graph.columnDefinition entity."; + var builder = new SourceColumnRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ColumnDefinitionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columns/{columnDefinition%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ColumnDefinitionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columns/{columnDefinition%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property columns for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of column definitions for this content type. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property columns in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ColumnDefinition body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ColumnDefinition body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of column definitions for this content type. + /// + public class ColumnDefinitionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs new file mode 100644 index 0000000000..06f172dfb6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Columns/Item/SourceColumn/SourceColumnRequestBuilder.cs @@ -0,0 +1,148 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Columns.Item.SourceColumn +{ + /// + /// Provides operations to manage the sourceColumn property of the microsoft.graph.columnDefinition entity. + /// + public class SourceColumnRequestBuilder : BaseCliRequestBuilder + { + /// + /// The source column for the content type column. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The source column for the content type column."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var columnDefinitionIdOption = new Option("--column-definition-id", description: "The unique identifier of columnDefinition") { + }; + columnDefinitionIdOption.IsRequired = true; + command.AddOption(columnDefinitionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var columnDefinitionId = invocationContext.ParseResult.GetValueForOption(columnDefinitionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (columnDefinitionId is not null) requestInfo.PathParameters.Add("columnDefinition%2Did", columnDefinitionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SourceColumnRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columns/{columnDefinition%2Did}/sourceColumn{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SourceColumnRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/columns/{columnDefinition%2Did}/sourceColumn{?%24expand,%24select}", rawUrl) + { + } + /// + /// The source column for the content type column. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The source column for the content type column. + /// + public class SourceColumnRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ContentTypeItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ContentTypeItemRequestBuilder.cs new file mode 100644 index 0000000000..5db559769d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/ContentTypeItemRequestBuilder.cs @@ -0,0 +1,498 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.AssociateWithHubSites; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Base; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.BaseTypes; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnLinks; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.ColumnPositions; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Columns; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.CopyToDefaultContentLocation; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.IsPublished; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Publish; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Unpublish; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item +{ + /// + /// Provides operations to manage the contentTypes property of the microsoft.graph.list entity. + /// + public class ContentTypeItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the associateWithHubSites method. + /// + /// A + public Command BuildAssociateWithHubSitesNavCommand() + { + var command = new Command("associate-with-hub-sites"); + command.Description = "Provides operations to call the associateWithHubSites method."; + var builder = new AssociateWithHubSitesRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the base property of the microsoft.graph.contentType entity. + /// + /// A + public Command BuildBaseNavCommand() + { + var command = new Command("base"); + command.Description = "Provides operations to manage the base property of the microsoft.graph.contentType entity."; + var builder = new BaseRequestBuilderEscaped(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the baseTypes property of the microsoft.graph.contentType entity. + /// + /// A + public Command BuildBaseTypesNavCommand() + { + var command = new Command("base-types"); + command.Description = "Provides operations to manage the baseTypes property of the microsoft.graph.contentType entity."; + var builder = new BaseTypesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the columnLinks property of the microsoft.graph.contentType entity. + /// + /// A + public Command BuildColumnLinksNavCommand() + { + var command = new Command("column-links"); + command.Description = "Provides operations to manage the columnLinks property of the microsoft.graph.contentType entity."; + var builder = new ColumnLinksRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the columnPositions property of the microsoft.graph.contentType entity. + /// + /// A + public Command BuildColumnPositionsNavCommand() + { + var command = new Command("column-positions"); + command.Description = "Provides operations to manage the columnPositions property of the microsoft.graph.contentType entity."; + var builder = new ColumnPositionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the columns property of the microsoft.graph.contentType entity. + /// + /// A + public Command BuildColumnsNavCommand() + { + var command = new Command("columns"); + command.Description = "Provides operations to manage the columns property of the microsoft.graph.contentType entity."; + var builder = new ColumnsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the copyToDefaultContentLocation method. + /// + /// A + public Command BuildCopyToDefaultContentLocationNavCommand() + { + var command = new Command("copy-to-default-content-location"); + command.Description = "Provides operations to call the copyToDefaultContentLocation method."; + var builder = new CopyToDefaultContentLocationRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property contentTypes for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property contentTypes for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The collection of content types present in this list. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The collection of content types present in this list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the isPublished method. + /// + /// A + public Command BuildIsPublishedNavCommand() + { + var command = new Command("is-published"); + command.Description = "Provides operations to call the isPublished method."; + var builder = new IsPublishedRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property contentTypes in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property contentTypes in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ContentType.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the publish method. + /// + /// A + public Command BuildPublishNavCommand() + { + var command = new Command("publish"); + command.Description = "Provides operations to call the publish method."; + var builder = new PublishRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the unpublish method. + /// + /// A + public Command BuildUnpublishNavCommand() + { + var command = new Command("unpublish"); + command.Description = "Provides operations to call the unpublish method."; + var builder = new UnpublishRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentTypeItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentTypeItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property contentTypes for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of content types present in this list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property contentTypes in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ContentType body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ContentType body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of content types present in this list. + /// + public class ContentTypeItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationPostRequestBody.cs new file mode 100644 index 0000000000..0d918919b2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.CopyToDefaultContentLocation +{ + #pragma warning disable CS1591 + public class CopyToDefaultContentLocationPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The destinationFileName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DestinationFileName { get; set; } +#nullable restore +#else + public string DestinationFileName { get; set; } +#endif + /// The sourceFile property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ItemReference? SourceFile { get; set; } +#nullable restore +#else + public ItemReference SourceFile { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CopyToDefaultContentLocationPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CopyToDefaultContentLocationPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CopyToDefaultContentLocationPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "destinationFileName", n => { DestinationFileName = n.GetStringValue(); } }, + { "sourceFile", n => { SourceFile = n.GetObjectValue(ItemReference.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("destinationFileName", DestinationFileName); + writer.WriteObjectValue("sourceFile", SourceFile); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs new file mode 100644 index 0000000000..7507eb4f65 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/CopyToDefaultContentLocation/CopyToDefaultContentLocationRequestBuilder.cs @@ -0,0 +1,107 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.CopyToDefaultContentLocation +{ + /// + /// Provides operations to call the copyToDefaultContentLocation method. + /// + public class CopyToDefaultContentLocationRequestBuilder : BaseCliRequestBuilder + { + /// + /// Copy a file to a default content location in a content type. The file can then be added as a default file or template via a POST operation. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Copy a file to a default content location in a content type. The file can then be added as a default file or template via a POST operation.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/contenttype-copytodefaultcontentlocation?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CopyToDefaultContentLocationPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CopyToDefaultContentLocationRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/copyToDefaultContentLocation", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CopyToDefaultContentLocationRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/copyToDefaultContentLocation", rawUrl) + { + } + /// + /// Copy a file to a default content location in a content type. The file can then be added as a default file or template via a POST operation. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CopyToDefaultContentLocationPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CopyToDefaultContentLocationPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/IsPublished/IsPublishedGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/IsPublished/IsPublishedGetResponse.cs new file mode 100644 index 0000000000..49602a315e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/IsPublished/IsPublishedGetResponse.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.IsPublished +{ + #pragma warning disable CS1591 + public class IsPublishedGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property + public bool? Value { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public IsPublishedGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static IsPublishedGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IsPublishedGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs new file mode 100644 index 0000000000..e9ad7972d5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/IsPublished/IsPublishedRequestBuilder.cs @@ -0,0 +1,102 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.IsPublished +{ + /// + /// Provides operations to call the isPublished method. + /// + public class IsPublishedRequestBuilder : BaseCliRequestBuilder + { + /// + /// Check the publishing status of a contentType in a content type hub site. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Check the publishing status of a contentType in a content type hub site.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/contenttype-ispublished?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public IsPublishedRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/isPublished()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public IsPublishedRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/isPublished()", rawUrl) + { + } + /// + /// Check the publishing status of a contentType in a content type hub site. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs new file mode 100644 index 0000000000..4cbd88ee34 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Publish/PublishRequestBuilder.cs @@ -0,0 +1,92 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Publish +{ + /// + /// Provides operations to call the publish method. + /// + public class PublishRequestBuilder : BaseCliRequestBuilder + { + /// + /// Publishes a contentType present in the content type hub site. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Publishes a contentType present in the content type hub site.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/contenttype-publish?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PublishRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/publish", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PublishRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/publish", rawUrl) + { + } + /// + /// Publishes a contentType present in the content type hub site. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs new file mode 100644 index 0000000000..0341036031 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ContentTypes/Item/Unpublish/UnpublishRequestBuilder.cs @@ -0,0 +1,92 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes.Item.Unpublish +{ + /// + /// Provides operations to call the unpublish method. + /// + public class UnpublishRequestBuilder : BaseCliRequestBuilder + { + /// + /// Unpublish a contentType from a content type hub site. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Unpublish a contentType from a content type hub site.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/contenttype-unpublish?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var contentTypeIdOption = new Option("--content-type-id", description: "The unique identifier of contentType") { + }; + contentTypeIdOption.IsRequired = true; + command.AddOption(contentTypeIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var contentTypeId = invocationContext.ParseResult.GetValueForOption(contentTypeIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (contentTypeId is not null) requestInfo.PathParameters.Add("contentType%2Did", contentTypeId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public UnpublishRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/unpublish", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public UnpublishRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/contentTypes/{contentType%2Did}/unpublish", rawUrl) + { + } + /// + /// Unpublish a contentType from a content type hub site. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/CreatedByUserRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/CreatedByUserRequestBuilder.cs new file mode 100644 index 0000000000..b0eaa17a4b --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/CreatedByUserRequestBuilder.cs @@ -0,0 +1,179 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.CreatedByUser.MailboxSettings; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.CreatedByUser.ServiceProvisioningErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.CreatedByUser +{ + /// + /// Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity. + /// + public class CreatedByUserRequestBuilder : BaseCliRequestBuilder + { + /// + /// Identity of the user who created the item. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Identity of the user who created the item. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The mailboxSettings property + /// + /// A + public Command BuildMailboxSettingsNavCommand() + { + var command = new Command("mailbox-settings"); + command.Description = "The mailboxSettings property"; + var builder = new MailboxSettingsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The serviceProvisioningErrors property + /// + /// A + public Command BuildServiceProvisioningErrorsNavCommand() + { + var command = new Command("service-provisioning-errors"); + command.Description = "The serviceProvisioningErrors property"; + var builder = new ServiceProvisioningErrorsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CreatedByUserRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/createdByUser{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CreatedByUserRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/createdByUser{?%24expand,%24select}", rawUrl) + { + } + /// + /// Identity of the user who created the item. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Identity of the user who created the item. Read-only. + /// + public class CreatedByUserRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs new file mode 100644 index 0000000000..c66b72cf24 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs @@ -0,0 +1,208 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.CreatedByUser.MailboxSettings +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\list\createdByUser\mailboxSettings + /// + public class MailboxSettingsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update property mailboxSettings value. + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update property mailboxSettings value."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.MailboxSettings.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MailboxSettingsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/createdByUser/mailboxSettings{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MailboxSettingsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/createdByUser/mailboxSettings{?%24expand,%24select}", rawUrl) + { + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update property mailboxSettings value. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + public class MailboxSettingsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..d776d49365 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.CreatedByUser.ServiceProvisioningErrors.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/createdByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/createdByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs new file mode 100644 index 0000000000..2552aa16e0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs @@ -0,0 +1,243 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.CreatedByUser.ServiceProvisioningErrors.Count; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.CreatedByUser.ServiceProvisioningErrors +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\list\createdByUser\serviceProvisioningErrors + /// + public class ServiceProvisioningErrorsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance)."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ServiceProvisioningErrorsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/createdByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ServiceProvisioningErrorsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/createdByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + public class ServiceProvisioningErrorsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Drive/DriveRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Drive/DriveRequestBuilder.cs new file mode 100644 index 0000000000..3ca17a666c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Drive/DriveRequestBuilder.cs @@ -0,0 +1,136 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Drive +{ + /// + /// Provides operations to manage the drive property of the microsoft.graph.list entity. + /// + public class DriveRequestBuilder : BaseCliRequestBuilder + { + /// + /// Allows access to the list as a drive resource with driveItems. Only present on document libraries. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Allows access to the list as a drive resource with driveItems. Only present on document libraries."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/drive{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/drive{?%24expand,%24select}", rawUrl) + { + } + /// + /// Allows access to the list as a drive resource with driveItems. Only present on document libraries. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Allows access to the list as a drive resource with driveItems. Only present on document libraries. + /// + public class DriveRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Delta/DeltaGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Delta/DeltaGetResponse.cs new file mode 100644 index 0000000000..98479e4c60 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Delta/DeltaGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Delta +{ + #pragma warning disable CS1591 + public class DeltaGetResponse : BaseDeltaFunctionResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new DeltaGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeltaGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.ListItem.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Delta/DeltaRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Delta/DeltaRequestBuilder.cs new file mode 100644 index 0000000000..947311dafa --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Delta/DeltaRequestBuilder.cs @@ -0,0 +1,225 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Delta +{ + /// + /// Provides operations to call the delta method. + /// + public class DeltaRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get newly created, updated, or deleted list items without having to perform a full read of the entire items collection. Your app begins by calling delta without any parameters.The service starts enumerating the hierarchy of the list, returning pages of items, and either an @odata.nextLink or an @odata.deltaLink.Your app should continue calling with the @odata.nextLink until you see an @odata.deltaLink returned. After you received all the changes, you can apply them to your local state.To check for changes in the future, call delta again with the @odata.deltaLink from the previous response. The delta feed shows the latest state for each item, not each change. If an item was renamed twice, it only shows up once, with its latest name.The same item might appear more than once in a delta feed, for various reasons. You should use the last occurrence you see. Items with this property should be removed from your local state. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get newly created, updated, or deleted list items without having to perform a full read of the entire items collection. Your app begins by calling delta without any parameters.The service starts enumerating the hierarchy of the list, returning pages of items, and either an @odata.nextLink or an @odata.deltaLink.Your app should continue calling with the @odata.nextLink until you see an @odata.deltaLink returned. After you received all the changes, you can apply them to your local state.To check for changes in the future, call delta again with the @odata.deltaLink from the previous response. The delta feed shows the latest state for each item, not each change. If an item was renamed twice, it only shows up once, with its latest name.The same item might appear more than once in a delta feed, for various reasons. You should use the last occurrence you see. Items with this property should be removed from your local state.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/listitem-delta?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DeltaRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/delta(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DeltaRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/delta(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get newly created, updated, or deleted list items without having to perform a full read of the entire items collection. Your app begins by calling delta without any parameters.The service starts enumerating the hierarchy of the list, returning pages of items, and either an @odata.nextLink or an @odata.deltaLink.Your app should continue calling with the @odata.nextLink until you see an @odata.deltaLink returned. After you received all the changes, you can apply them to your local state.To check for changes in the future, call delta again with the @odata.deltaLink from the previous response. The delta feed shows the latest state for each item, not each change. If an item was renamed twice, it only shows up once, with its latest name.The same item might appear more than once in a delta feed, for various reasons. You should use the last occurrence you see. Items with this property should be removed from your local state. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get newly created, updated, or deleted list items without having to perform a full read of the entire items collection. Your app begins by calling delta without any parameters.The service starts enumerating the hierarchy of the list, returning pages of items, and either an @odata.nextLink or an @odata.deltaLink.Your app should continue calling with the @odata.nextLink until you see an @odata.deltaLink returned. After you received all the changes, you can apply them to your local state.To check for changes in the future, call delta again with the @odata.deltaLink from the previous response. The delta feed shows the latest state for each item, not each change. If an item was renamed twice, it only shows up once, with its latest name.The same item might appear more than once in a delta feed, for various reasons. You should use the last occurrence you see. Items with this property should be removed from your local state. + /// + public class DeltaRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/DeltaWithToken/DeltaWithTokenGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/DeltaWithToken/DeltaWithTokenGetResponse.cs new file mode 100644 index 0000000000..8be53d1c6a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/DeltaWithToken/DeltaWithTokenGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.DeltaWithToken +{ + #pragma warning disable CS1591 + public class DeltaWithTokenGetResponse : BaseDeltaFunctionResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new DeltaWithTokenGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeltaWithTokenGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.ListItem.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/DeltaWithToken/DeltaWithTokenRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/DeltaWithToken/DeltaWithTokenRequestBuilder.cs new file mode 100644 index 0000000000..2e5fcebb4e --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/DeltaWithToken/DeltaWithTokenRequestBuilder.cs @@ -0,0 +1,230 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.DeltaWithToken +{ + /// + /// Provides operations to call the delta method. + /// + public class DeltaWithTokenRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function delta + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function delta"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var tokenOption = new Option("--token", description: "Usage: token='{token}'") { + }; + tokenOption.IsRequired = true; + command.AddOption(tokenOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var token = invocationContext.ParseResult.GetValueForOption(tokenOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (token is not null) requestInfo.PathParameters.Add("token", token); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DeltaWithTokenRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/delta(token='{token}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DeltaWithTokenRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/delta(token='{token}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Invoke function delta + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Invoke function delta + /// + public class DeltaWithTokenRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs new file mode 100644 index 0000000000..e4aaf018b0 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Analytics/AnalyticsRequestBuilder.cs @@ -0,0 +1,142 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Analytics +{ + /// + /// Provides operations to manage the analytics property of the microsoft.graph.listItem entity. + /// + public class AnalyticsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Analytics about the view activities that took place on this item. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Analytics about the view activities that took place on this item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public AnalyticsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/analytics{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public AnalyticsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/analytics{?%24expand,%24select}", rawUrl) + { + } + /// + /// Analytics about the view activities that took place on this item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Analytics about the view activities that took place on this item. + /// + public class AnalyticsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreateLink/CreateLinkPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreateLink/CreateLinkPostRequestBody.cs new file mode 100644 index 0000000000..92cf763f65 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreateLink/CreateLinkPostRequestBody.cs @@ -0,0 +1,115 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreateLink +{ + #pragma warning disable CS1591 + public class CreateLinkPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The expirationDateTime property + public DateTimeOffset? ExpirationDateTime { get; set; } + /// The message property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Message { get; set; } +#nullable restore +#else + public string Message { get; set; } +#endif + /// The password property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// The recipients property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Recipients { get; set; } +#nullable restore +#else + public List Recipients { get; set; } +#endif + /// The retainInheritedPermissions property + public bool? RetainInheritedPermissions { get; set; } + /// The scope property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Scope { get; set; } +#nullable restore +#else + public string Scope { get; set; } +#endif + /// The sendNotification property + public bool? SendNotification { get; set; } + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CreateLinkPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static CreateLinkPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateLinkPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "expirationDateTime", n => { ExpirationDateTime = n.GetDateTimeOffsetValue(); } }, + { "message", n => { Message = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "recipients", n => { Recipients = n.GetCollectionOfObjectValues(DriveRecipient.CreateFromDiscriminatorValue)?.ToList(); } }, + { "retainInheritedPermissions", n => { RetainInheritedPermissions = n.GetBoolValue(); } }, + { "scope", n => { Scope = n.GetStringValue(); } }, + { "sendNotification", n => { SendNotification = n.GetBoolValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("expirationDateTime", ExpirationDateTime); + writer.WriteStringValue("message", Message); + writer.WriteStringValue("password", Password); + writer.WriteCollectionOfObjectValues("recipients", Recipients); + writer.WriteBoolValue("retainInheritedPermissions", RetainInheritedPermissions); + writer.WriteStringValue("scope", Scope); + writer.WriteBoolValue("sendNotification", SendNotification); + writer.WriteStringValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreateLink/CreateLinkRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreateLink/CreateLinkRequestBuilder.cs new file mode 100644 index 0000000000..7af9bc4800 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreateLink/CreateLinkRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreateLink +{ + /// + /// Provides operations to call the createLink method. + /// + public class CreateLinkRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke action createLink + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Invoke action createLink"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(CreateLinkPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CreateLinkRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createLink", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CreateLinkRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createLink", rawUrl) + { + } + /// + /// Invoke action createLink + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateLinkPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateLinkPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/CreatedByUserRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/CreatedByUserRequestBuilder.cs new file mode 100644 index 0000000000..2af0c61ab8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/CreatedByUserRequestBuilder.cs @@ -0,0 +1,185 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreatedByUser.MailboxSettings; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreatedByUser.ServiceProvisioningErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreatedByUser +{ + /// + /// Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity. + /// + public class CreatedByUserRequestBuilder : BaseCliRequestBuilder + { + /// + /// Identity of the user who created the item. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Identity of the user who created the item. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The mailboxSettings property + /// + /// A + public Command BuildMailboxSettingsNavCommand() + { + var command = new Command("mailbox-settings"); + command.Description = "The mailboxSettings property"; + var builder = new MailboxSettingsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The serviceProvisioningErrors property + /// + /// A + public Command BuildServiceProvisioningErrorsNavCommand() + { + var command = new Command("service-provisioning-errors"); + command.Description = "The serviceProvisioningErrors property"; + var builder = new ServiceProvisioningErrorsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CreatedByUserRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createdByUser{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CreatedByUserRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createdByUser{?%24expand,%24select}", rawUrl) + { + } + /// + /// Identity of the user who created the item. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Identity of the user who created the item. Read-only. + /// + public class CreatedByUserRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs new file mode 100644 index 0000000000..5ff923692d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs @@ -0,0 +1,220 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreatedByUser.MailboxSettings +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\list\items\{listItem-id}\createdByUser\mailboxSettings + /// + public class MailboxSettingsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update property mailboxSettings value. + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update property mailboxSettings value."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.MailboxSettings.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MailboxSettingsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createdByUser/mailboxSettings{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MailboxSettingsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createdByUser/mailboxSettings{?%24expand,%24select}", rawUrl) + { + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update property mailboxSettings value. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + public class MailboxSettingsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..535980af36 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreatedByUser.ServiceProvisioningErrors.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createdByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createdByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs new file mode 100644 index 0000000000..9edbcb1dc3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/CreatedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs @@ -0,0 +1,249 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreatedByUser.ServiceProvisioningErrors.Count; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreatedByUser.ServiceProvisioningErrors +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\list\items\{listItem-id}\createdByUser\serviceProvisioningErrors + /// + public class ServiceProvisioningErrorsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance)."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ServiceProvisioningErrorsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createdByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ServiceProvisioningErrorsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/createdByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + public class ServiceProvisioningErrorsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..77cc322267 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/DocumentSetVersionsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/DocumentSetVersionsRequestBuilder.cs new file mode 100644 index 0000000000..1363be021c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/DocumentSetVersionsRequestBuilder.cs @@ -0,0 +1,344 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions +{ + /// + /// Provides operations to manage the documentSetVersions property of the microsoft.graph.listItem entity. + /// + public class DocumentSetVersionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the documentSetVersions property of the microsoft.graph.listItem entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new DocumentSetVersionItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildFieldsNavCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRestoreNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to documentSetVersions for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to documentSetVersions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DocumentSetVersion.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Version information for a document set version created by a user. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Version information for a document set version created by a user."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DocumentSetVersionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DocumentSetVersionsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Version information for a document set version created by a user. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to documentSetVersions for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DocumentSetVersion body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DocumentSetVersion body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Version information for a document set version created by a user. + /// + public class DocumentSetVersionsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Item/DocumentSetVersionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Item/DocumentSetVersionItemRequestBuilder.cs new file mode 100644 index 0000000000..dade36c245 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Item/DocumentSetVersionItemRequestBuilder.cs @@ -0,0 +1,336 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions.Item.Fields; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions.Item.Restore; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions.Item +{ + /// + /// Provides operations to manage the documentSetVersions property of the microsoft.graph.listItem entity. + /// + public class DocumentSetVersionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property documentSetVersions for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property documentSetVersions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var documentSetVersionIdOption = new Option("--document-set-version-id", description: "The unique identifier of documentSetVersion") { + }; + documentSetVersionIdOption.IsRequired = true; + command.AddOption(documentSetVersionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var documentSetVersionId = invocationContext.ParseResult.GetValueForOption(documentSetVersionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (documentSetVersionId is not null) requestInfo.PathParameters.Add("documentSetVersion%2Did", documentSetVersionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the fields property of the microsoft.graph.listItemVersion entity. + /// + /// A + public Command BuildFieldsNavCommand() + { + var command = new Command("fields"); + command.Description = "Provides operations to manage the fields property of the microsoft.graph.listItemVersion entity."; + var builder = new FieldsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Version information for a document set version created by a user. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Version information for a document set version created by a user."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var documentSetVersionIdOption = new Option("--document-set-version-id", description: "The unique identifier of documentSetVersion") { + }; + documentSetVersionIdOption.IsRequired = true; + command.AddOption(documentSetVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var documentSetVersionId = invocationContext.ParseResult.GetValueForOption(documentSetVersionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (documentSetVersionId is not null) requestInfo.PathParameters.Add("documentSetVersion%2Did", documentSetVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property documentSetVersions in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property documentSetVersions in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var documentSetVersionIdOption = new Option("--document-set-version-id", description: "The unique identifier of documentSetVersion") { + }; + documentSetVersionIdOption.IsRequired = true; + command.AddOption(documentSetVersionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var documentSetVersionId = invocationContext.ParseResult.GetValueForOption(documentSetVersionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(DocumentSetVersion.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (documentSetVersionId is not null) requestInfo.PathParameters.Add("documentSetVersion%2Did", documentSetVersionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the restore method. + /// + /// A + public Command BuildRestoreNavCommand() + { + var command = new Command("restore"); + command.Description = "Provides operations to call the restore method."; + var builder = new RestoreRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DocumentSetVersionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions/{documentSetVersion%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DocumentSetVersionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions/{documentSetVersion%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property documentSetVersions for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Version information for a document set version created by a user. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property documentSetVersions in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(DocumentSetVersion body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(DocumentSetVersion body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Version information for a document set version created by a user. + /// + public class DocumentSetVersionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Item/Fields/FieldsRequestBuilder.cs new file mode 100644 index 0000000000..1f2ffacdb3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Item/Fields/FieldsRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions.Item.Fields +{ + /// + /// Provides operations to manage the fields property of the microsoft.graph.listItemVersion entity. + /// + public class FieldsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property fields for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fields for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var documentSetVersionIdOption = new Option("--document-set-version-id", description: "The unique identifier of documentSetVersion") { + }; + documentSetVersionIdOption.IsRequired = true; + command.AddOption(documentSetVersionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var documentSetVersionId = invocationContext.ParseResult.GetValueForOption(documentSetVersionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (documentSetVersionId is not null) requestInfo.PathParameters.Add("documentSetVersion%2Did", documentSetVersionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// A collection of the fields and values for this version of the list item. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "A collection of the fields and values for this version of the list item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var documentSetVersionIdOption = new Option("--document-set-version-id", description: "The unique identifier of documentSetVersion") { + }; + documentSetVersionIdOption.IsRequired = true; + command.AddOption(documentSetVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var documentSetVersionId = invocationContext.ParseResult.GetValueForOption(documentSetVersionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (documentSetVersionId is not null) requestInfo.PathParameters.Add("documentSetVersion%2Did", documentSetVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fields in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fields in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var documentSetVersionIdOption = new Option("--document-set-version-id", description: "The unique identifier of documentSetVersion") { + }; + documentSetVersionIdOption.IsRequired = true; + command.AddOption(documentSetVersionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var documentSetVersionId = invocationContext.ParseResult.GetValueForOption(documentSetVersionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FieldValueSet.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (documentSetVersionId is not null) requestInfo.PathParameters.Add("documentSetVersion%2Did", documentSetVersionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FieldsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions/{documentSetVersion%2Did}/fields{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FieldsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions/{documentSetVersion%2Did}/fields{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fields for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// A collection of the fields and values for this version of the list item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fields in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(FieldValueSet body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(FieldValueSet body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// A collection of the fields and values for this version of the list item. + /// + public class FieldsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Item/Restore/RestoreRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Item/Restore/RestoreRequestBuilder.cs new file mode 100644 index 0000000000..0a18f4fba7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DocumentSetVersions/Item/Restore/RestoreRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions.Item.Restore +{ + /// + /// Provides operations to call the restore method. + /// + public class RestoreRequestBuilder : BaseCliRequestBuilder + { + /// + /// Restore a document set version. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Restore a document set version.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/documentsetversion-restore?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var documentSetVersionIdOption = new Option("--document-set-version-id", description: "The unique identifier of documentSetVersion") { + }; + documentSetVersionIdOption.IsRequired = true; + command.AddOption(documentSetVersionIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var documentSetVersionId = invocationContext.ParseResult.GetValueForOption(documentSetVersionIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (documentSetVersionId is not null) requestInfo.PathParameters.Add("documentSetVersion%2Did", documentSetVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RestoreRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions/{documentSetVersion%2Did}/restore", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RestoreRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/documentSetVersions/{documentSetVersion%2Did}/restore", rawUrl) + { + } + /// + /// Restore a document set version. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000000..125e1684f4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DriveItem/Content/ContentRequestBuilder.cs @@ -0,0 +1,262 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DriveItem.Content +{ + /// + /// Provides operations to manage the media for the storage entity. + /// + public class ContentRequestBuilder : BaseCliRequestBuilder + { + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var formatOption = new Option("--format", description: "Format of the content") { + }; + formatOption.IsRequired = false; + command.AddOption(formatOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var format = invocationContext.ParseResult.GetValueForOption(formatOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(format)) q.QueryParameters.Format = format; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildPutCommand() + { + var command = new Command("put"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var inputFileOption = new Option("--input-file", description: "Binary request body") { + }; + inputFileOption.IsRequired = true; + command.AddOption(inputFileOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var inputFile = invocationContext.ParseResult.GetValueForOption(inputFileOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + if (inputFile is null || !inputFile.Exists) { + Console.Error.WriteLine("No available file to send."); + return; + } + using var stream = inputFile.OpenRead(); + var requestInfo = ToPutRequestInformation(stream, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/driveItem/content{?%24format*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/driveItem/content{?%24format*}", rawUrl) + { + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Stream body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Stream body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetStreamContent(body, "application/octet-stream"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + public class ContentRequestBuilderGetQueryParameters + { + /// Format of the content +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("%24format")] + public string Format { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs new file mode 100644 index 0000000000..40a7fe0495 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/DriveItem/DriveItemRequestBuilder.cs @@ -0,0 +1,162 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DriveItem.Content; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DriveItem +{ + /// + /// Provides operations to manage the driveItem property of the microsoft.graph.listItem entity. + /// + public class DriveItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the media for the storage entity. + /// + /// A + public Command BuildContentNavCommand() + { + var command = new Command("content"); + command.Description = "Provides operations to manage the media for the storage entity."; + var builder = new ContentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPutCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// For document libraries, the driveItem relationship exposes the listItem as a driveItem + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "For document libraries, the driveItem relationship exposes the listItem as a driveItem"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/driveItem{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/driveItem{?%24expand,%24select}", rawUrl) + { + } + /// + /// For document libraries, the driveItem relationship exposes the listItem as a driveItem + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// For document libraries, the driveItem relationship exposes the listItem as a driveItem + /// + public class DriveItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Fields/FieldsRequestBuilder.cs new file mode 100644 index 0000000000..aa65b25557 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Fields/FieldsRequestBuilder.cs @@ -0,0 +1,280 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Fields +{ + /// + /// Provides operations to manage the fields property of the microsoft.graph.listItem entity. + /// + public class FieldsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property fields for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fields for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The values of the columns set on this list item. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The values of the columns set on this list item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fields in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fields in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FieldValueSet.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FieldsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/fields{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FieldsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/fields{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fields for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The values of the columns set on this list item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fields in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(FieldValueSet body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(FieldValueSet body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The values of the columns set on this list item. + /// + public class FieldsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalGetResponse.cs new file mode 100644 index 0000000000..2dddb638c3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.GetActivitiesByInterval +{ + #pragma warning disable CS1591 + public class GetActivitiesByIntervalGetResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new GetActivitiesByIntervalGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GetActivitiesByIntervalGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ItemActivityStat.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs new file mode 100644 index 0000000000..451e7a7fed --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByInterval/GetActivitiesByIntervalRequestBuilder.cs @@ -0,0 +1,230 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.GetActivitiesByInterval +{ + /// + /// Provides operations to call the getActivitiesByInterval method. + /// + public class GetActivitiesByIntervalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function getActivitiesByInterval + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function getActivitiesByInterval"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GetActivitiesByIntervalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/getActivitiesByInterval(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GetActivitiesByIntervalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/getActivitiesByInterval(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Invoke function getActivitiesByInterval + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Invoke function getActivitiesByInterval + /// + public class GetActivitiesByIntervalRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse.cs new file mode 100644 index 0000000000..f365701423 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval +{ + #pragma warning disable CS1591 + public class GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ItemActivityStat.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs new file mode 100644 index 0000000000..c8799f4276 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval/GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.cs @@ -0,0 +1,248 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval +{ + /// + /// Provides operations to call the getActivitiesByInterval method. + /// + public class GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder : BaseCliRequestBuilder + { + /// + /// Invoke function getActivitiesByInterval + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Invoke function getActivitiesByInterval"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var startDateTimeOption = new Option("--start-date-time", description: "Usage: startDateTime='{startDateTime}'") { + }; + startDateTimeOption.IsRequired = true; + command.AddOption(startDateTimeOption); + var endDateTimeOption = new Option("--end-date-time", description: "Usage: endDateTime='{endDateTime}'") { + }; + endDateTimeOption.IsRequired = true; + command.AddOption(endDateTimeOption); + var intervalOption = new Option("--interval", description: "Usage: interval='{interval}'") { + }; + intervalOption.IsRequired = true; + command.AddOption(intervalOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var startDateTime = invocationContext.ParseResult.GetValueForOption(startDateTimeOption); + var endDateTime = invocationContext.ParseResult.GetValueForOption(endDateTimeOption); + var interval = invocationContext.ParseResult.GetValueForOption(intervalOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (startDateTime is not null) requestInfo.PathParameters.Add("startDateTime", startDateTime); + if (endDateTime is not null) requestInfo.PathParameters.Add("endDateTime", endDateTime); + if (interval is not null) requestInfo.PathParameters.Add("interval", interval); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/getActivitiesByInterval(startDateTime='{startDateTime}',endDateTime='{endDateTime}',interval='{interval}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/getActivitiesByInterval(startDateTime='{startDateTime}',endDateTime='{endDateTime}',interval='{interval}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Invoke function getActivitiesByInterval + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Invoke function getActivitiesByInterval + /// + public class GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs new file mode 100644 index 0000000000..d5818c14b2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs @@ -0,0 +1,185 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.LastModifiedByUser.MailboxSettings; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.LastModifiedByUser.ServiceProvisioningErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.LastModifiedByUser +{ + /// + /// Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity. + /// + public class LastModifiedByUserRequestBuilder : BaseCliRequestBuilder + { + /// + /// Identity of the user who last modified the item. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Identity of the user who last modified the item. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The mailboxSettings property + /// + /// A + public Command BuildMailboxSettingsNavCommand() + { + var command = new Command("mailbox-settings"); + command.Description = "The mailboxSettings property"; + var builder = new MailboxSettingsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The serviceProvisioningErrors property + /// + /// A + public Command BuildServiceProvisioningErrorsNavCommand() + { + var command = new Command("service-provisioning-errors"); + command.Description = "The serviceProvisioningErrors property"; + var builder = new ServiceProvisioningErrorsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LastModifiedByUserRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/lastModifiedByUser{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LastModifiedByUserRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/lastModifiedByUser{?%24expand,%24select}", rawUrl) + { + } + /// + /// Identity of the user who last modified the item. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Identity of the user who last modified the item. Read-only. + /// + public class LastModifiedByUserRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs new file mode 100644 index 0000000000..289b6ab0e6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs @@ -0,0 +1,220 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.LastModifiedByUser.MailboxSettings +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\list\items\{listItem-id}\lastModifiedByUser\mailboxSettings + /// + public class MailboxSettingsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update property mailboxSettings value. + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update property mailboxSettings value."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.MailboxSettings.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MailboxSettingsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/lastModifiedByUser/mailboxSettings{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MailboxSettingsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/lastModifiedByUser/mailboxSettings{?%24expand,%24select}", rawUrl) + { + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update property mailboxSettings value. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + public class MailboxSettingsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..51aff20e58 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.LastModifiedByUser.ServiceProvisioningErrors.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/lastModifiedByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/lastModifiedByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs new file mode 100644 index 0000000000..3006bea1f4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs @@ -0,0 +1,249 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.LastModifiedByUser.ServiceProvisioningErrors.Count; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.LastModifiedByUser.ServiceProvisioningErrors +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\list\items\{listItem-id}\lastModifiedByUser\serviceProvisioningErrors + /// + public class ServiceProvisioningErrorsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance)."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ServiceProvisioningErrorsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/lastModifiedByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ServiceProvisioningErrorsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/lastModifiedByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + public class ServiceProvisioningErrorsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/ListItemItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/ListItemItemRequestBuilder.cs new file mode 100644 index 0000000000..fdc9c64ebe --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/ListItemItemRequestBuilder.cs @@ -0,0 +1,502 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Analytics; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreateLink; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.CreatedByUser; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DocumentSetVersions; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.DriveItem; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Fields; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.GetActivitiesByInterval; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithInterval; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.LastModifiedByUser; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item +{ + /// + /// Provides operations to manage the items property of the microsoft.graph.list entity. + /// + public class ListItemItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the analytics property of the microsoft.graph.listItem entity. + /// + /// A + public Command BuildAnalyticsNavCommand() + { + var command = new Command("analytics"); + command.Description = "Provides operations to manage the analytics property of the microsoft.graph.listItem entity."; + var builder = new AnalyticsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity. + /// + /// A + public Command BuildCreatedByUserNavCommand() + { + var command = new Command("created-by-user"); + command.Description = "Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity."; + var builder = new CreatedByUserRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMailboxSettingsNavCommand()); + nonExecCommands.Add(builder.BuildServiceProvisioningErrorsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the createLink method. + /// + /// A + public Command BuildCreateLinkNavCommand() + { + var command = new Command("create-link"); + command.Description = "Provides operations to call the createLink method."; + var builder = new CreateLinkRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property items for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property items for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the documentSetVersions property of the microsoft.graph.listItem entity. + /// + /// A + public Command BuildDocumentSetVersionsNavCommand() + { + var command = new Command("document-set-versions"); + command.Description = "Provides operations to manage the documentSetVersions property of the microsoft.graph.listItem entity."; + var builder = new DocumentSetVersionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the driveItem property of the microsoft.graph.listItem entity. + /// + /// A + public Command BuildDriveItemNavCommand() + { + var command = new Command("drive-item"); + command.Description = "Provides operations to manage the driveItem property of the microsoft.graph.listItem entity."; + var builder = new DriveItemRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildContentNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the fields property of the microsoft.graph.listItem entity. + /// + /// A + public Command BuildFieldsNavCommand() + { + var command = new Command("fields"); + command.Description = "Provides operations to manage the fields property of the microsoft.graph.listItem entity."; + var builder = new FieldsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the getActivitiesByInterval method. + /// + /// A + public Command BuildGetActivitiesByIntervalNavCommand() + { + var command = new Command("get-activities-by-interval"); + command.Description = "Provides operations to call the getActivitiesByInterval method."; + var builder = new GetActivitiesByIntervalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the getActivitiesByInterval method. + /// + /// A + public Command BuildGetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRbCommand() + { + var command = new Command("get-activities-by-interval-with-start-date-time-with-end-date-time-with-interval"); + command.Description = "Provides operations to call the getActivitiesByInterval method."; + var builder = new GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// All items contained in the list. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "All items contained in the list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity. + /// + /// A + public Command BuildLastModifiedByUserNavCommand() + { + var command = new Command("last-modified-by-user"); + command.Description = "Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity."; + var builder = new LastModifiedByUserRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMailboxSettingsNavCommand()); + nonExecCommands.Add(builder.BuildServiceProvisioningErrorsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property items in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property items in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.ListItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the versions property of the microsoft.graph.listItem entity. + /// + /// A + public Command BuildVersionsNavCommand() + { + var command = new Command("versions"); + command.Description = "Provides operations to manage the versions property of the microsoft.graph.listItem entity."; + var builder = new VersionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ListItemItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ListItemItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property items for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// All items contained in the list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property items in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.ListItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.ListItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// All items contained in the list. + /// + public class ListItemItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..ceb0ed726d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Count/CountRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs new file mode 100644 index 0000000000..e08ca6ef11 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Item/Fields/FieldsRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions.Item.Fields +{ + /// + /// Provides operations to manage the fields property of the microsoft.graph.listItemVersion entity. + /// + public class FieldsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property fields for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fields for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--list-item-version-id", description: "The unique identifier of listItemVersion") { + }; + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var listItemVersionId = invocationContext.ParseResult.GetValueForOption(listItemVersionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (listItemVersionId is not null) requestInfo.PathParameters.Add("listItemVersion%2Did", listItemVersionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// A collection of the fields and values for this version of the list item. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "A collection of the fields and values for this version of the list item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--list-item-version-id", description: "The unique identifier of listItemVersion") { + }; + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var listItemVersionId = invocationContext.ParseResult.GetValueForOption(listItemVersionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (listItemVersionId is not null) requestInfo.PathParameters.Add("listItemVersion%2Did", listItemVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fields in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fields in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--list-item-version-id", description: "The unique identifier of listItemVersion") { + }; + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var listItemVersionId = invocationContext.ParseResult.GetValueForOption(listItemVersionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FieldValueSet.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (listItemVersionId is not null) requestInfo.PathParameters.Add("listItemVersion%2Did", listItemVersionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FieldsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions/{listItemVersion%2Did}/fields{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FieldsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions/{listItemVersion%2Did}/fields{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fields for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// A collection of the fields and values for this version of the list item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fields in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(FieldValueSet body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(FieldValueSet body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// A collection of the fields and values for this version of the list item. + /// + public class FieldsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Item/ListItemVersionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Item/ListItemVersionItemRequestBuilder.cs new file mode 100644 index 0000000000..512118b3b8 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Item/ListItemVersionItemRequestBuilder.cs @@ -0,0 +1,336 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions.Item.Fields; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions.Item.RestoreVersion; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions.Item +{ + /// + /// Provides operations to manage the versions property of the microsoft.graph.listItem entity. + /// + public class ListItemVersionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property versions for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property versions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--list-item-version-id", description: "The unique identifier of listItemVersion") { + }; + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var listItemVersionId = invocationContext.ParseResult.GetValueForOption(listItemVersionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (listItemVersionId is not null) requestInfo.PathParameters.Add("listItemVersion%2Did", listItemVersionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the fields property of the microsoft.graph.listItemVersion entity. + /// + /// A + public Command BuildFieldsNavCommand() + { + var command = new Command("fields"); + command.Description = "Provides operations to manage the fields property of the microsoft.graph.listItemVersion entity."; + var builder = new FieldsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The list of previous versions of the list item. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The list of previous versions of the list item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--list-item-version-id", description: "The unique identifier of listItemVersion") { + }; + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var listItemVersionId = invocationContext.ParseResult.GetValueForOption(listItemVersionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (listItemVersionId is not null) requestInfo.PathParameters.Add("listItemVersion%2Did", listItemVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property versions in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property versions in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--list-item-version-id", description: "The unique identifier of listItemVersion") { + }; + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var listItemVersionId = invocationContext.ParseResult.GetValueForOption(listItemVersionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ListItemVersion.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (listItemVersionId is not null) requestInfo.PathParameters.Add("listItemVersion%2Did", listItemVersionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the restoreVersion method. + /// + /// A + public Command BuildRestoreVersionNavCommand() + { + var command = new Command("restore-version"); + command.Description = "Provides operations to call the restoreVersion method."; + var builder = new RestoreVersionRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ListItemVersionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions/{listItemVersion%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ListItemVersionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions/{listItemVersion%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property versions for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The list of previous versions of the list item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property versions in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ListItemVersion body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ListItemVersion body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The list of previous versions of the list item. + /// + public class ListItemVersionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs new file mode 100644 index 0000000000..430160ffad --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/Item/RestoreVersion/RestoreVersionRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions.Item.RestoreVersion +{ + /// + /// Provides operations to call the restoreVersion method. + /// + public class RestoreVersionRequestBuilder : BaseCliRequestBuilder + { + /// + /// Restore a previous version of a ListItem to be the current version. This will create a new version with the contents of the previous version, but preserves all existing versions of the item. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Restore a previous version of a ListItem to be the current version. This will create a new version with the contents of the previous version, but preserves all existing versions of the item.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/listitemversion-restore?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var listItemVersionIdOption = new Option("--list-item-version-id", description: "The unique identifier of listItemVersion") { + }; + listItemVersionIdOption.IsRequired = true; + command.AddOption(listItemVersionIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var listItemVersionId = invocationContext.ParseResult.GetValueForOption(listItemVersionIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + if (listItemVersionId is not null) requestInfo.PathParameters.Add("listItemVersion%2Did", listItemVersionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RestoreVersionRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions/{listItemVersion%2Did}/restoreVersion", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RestoreVersionRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions/{listItemVersion%2Did}/restoreVersion", rawUrl) + { + } + /// + /// Restore a previous version of a ListItem to be the current version. This will create a new version with the contents of the previous version, but preserves all existing versions of the item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/VersionsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/VersionsRequestBuilder.cs new file mode 100644 index 0000000000..220b38b2d1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/Item/Versions/VersionsRequestBuilder.cs @@ -0,0 +1,344 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item.Versions +{ + /// + /// Provides operations to manage the versions property of the microsoft.graph.listItem entity. + /// + public class VersionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the versions property of the microsoft.graph.listItem entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new ListItemVersionItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildFieldsNavCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildRestoreVersionNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to versions for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to versions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ListItemVersion.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The list of previous versions of the list item. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The list of previous versions of the list item."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var listItemIdOption = new Option("--list-item-id", description: "The unique identifier of listItem") { + }; + listItemIdOption.IsRequired = true; + command.AddOption(listItemIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var listItemId = invocationContext.ParseResult.GetValueForOption(listItemIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (listItemId is not null) requestInfo.PathParameters.Add("listItem%2Did", listItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public VersionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public VersionsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items/{listItem%2Did}/versions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The list of previous versions of the list item. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to versions for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ListItemVersion body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ListItemVersion body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The list of previous versions of the list item. + /// + public class VersionsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/ItemsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/ItemsRequestBuilder.cs new file mode 100644 index 0000000000..97084a18f6 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Items/ItemsRequestBuilder.cs @@ -0,0 +1,349 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Delta; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.DeltaWithToken; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items +{ + /// + /// Provides operations to manage the items property of the microsoft.graph.list entity. + /// + public class ItemsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the items property of the microsoft.graph.list entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new ListItemItemRequestBuilder(PathParameters); + commands.Add(builder.BuildAnalyticsNavCommand()); + commands.Add(builder.BuildCreatedByUserNavCommand()); + commands.Add(builder.BuildCreateLinkNavCommand()); + executables.Add(builder.BuildDeleteCommand()); + commands.Add(builder.BuildDocumentSetVersionsNavCommand()); + commands.Add(builder.BuildDriveItemNavCommand()); + commands.Add(builder.BuildFieldsNavCommand()); + commands.Add(builder.BuildGetActivitiesByIntervalNavCommand()); + commands.Add(builder.BuildGetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRbCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildLastModifiedByUserNavCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildVersionsNavCommand()); + return new(executables, commands); + } + /// + /// Create new navigation property to items for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to items for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.ListItem.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the delta method. + /// + /// A + public Command BuildDeltaNavCommand() + { + var command = new Command("delta"); + command.Description = "Provides operations to call the delta method."; + var builder = new DeltaRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to call the delta method. + /// + /// A + public Command BuildDeltaWithTokenRbCommand() + { + var command = new Command("delta-with-token"); + command.Description = "Provides operations to call the delta method."; + var builder = new DeltaWithTokenRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// All items contained in the list. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "All items contained in the list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ItemsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items{?%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ItemsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/items{?%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// All items contained in the list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to items for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApiSdk.Models.ListItem body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApiSdk.Models.ListItem body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// All items contained in the list. + /// + public class ItemsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs new file mode 100644 index 0000000000..f6c93f367a --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/LastModifiedByUserRequestBuilder.cs @@ -0,0 +1,179 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.LastModifiedByUser.MailboxSettings; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.LastModifiedByUser.ServiceProvisioningErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.LastModifiedByUser +{ + /// + /// Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity. + /// + public class LastModifiedByUserRequestBuilder : BaseCliRequestBuilder + { + /// + /// Identity of the user who last modified the item. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Identity of the user who last modified the item. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The mailboxSettings property + /// + /// A + public Command BuildMailboxSettingsNavCommand() + { + var command = new Command("mailbox-settings"); + command.Description = "The mailboxSettings property"; + var builder = new MailboxSettingsRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The serviceProvisioningErrors property + /// + /// A + public Command BuildServiceProvisioningErrorsNavCommand() + { + var command = new Command("service-provisioning-errors"); + command.Description = "The serviceProvisioningErrors property"; + var builder = new ServiceProvisioningErrorsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public LastModifiedByUserRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/lastModifiedByUser{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public LastModifiedByUserRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/lastModifiedByUser{?%24expand,%24select}", rawUrl) + { + } + /// + /// Identity of the user who last modified the item. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Identity of the user who last modified the item. Read-only. + /// + public class LastModifiedByUserRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs new file mode 100644 index 0000000000..8bb3de5ac4 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/MailboxSettings/MailboxSettingsRequestBuilder.cs @@ -0,0 +1,208 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.LastModifiedByUser.MailboxSettings +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\list\lastModifiedByUser\mailboxSettings + /// + public class MailboxSettingsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update property mailboxSettings value. + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update property mailboxSettings value."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.MailboxSettings.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public MailboxSettingsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/lastModifiedByUser/mailboxSettings{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public MailboxSettingsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/lastModifiedByUser/mailboxSettings{?%24expand,%24select}", rawUrl) + { + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update property mailboxSettings value. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.MailboxSettings body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Settings for the primary mailbox of the signed-in user. You can get or update settings for sending automatic replies to incoming messages, locale, and time zone. Returned only on $select. + /// + public class MailboxSettingsRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..a50de35158 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/ServiceProvisioningErrors/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.LastModifiedByUser.ServiceProvisioningErrors.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/lastModifiedByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/lastModifiedByUser/serviceProvisioningErrors/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs new file mode 100644 index 0000000000..0aa77e1d49 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/LastModifiedByUser/ServiceProvisioningErrors/ServiceProvisioningErrorsRequestBuilder.cs @@ -0,0 +1,243 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.LastModifiedByUser.ServiceProvisioningErrors.Count; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.LastModifiedByUser.ServiceProvisioningErrors +{ + /// + /// Builds and executes requests for operations under \storage\fileStorage\containers\{fileStorageContainer-id}\drive\list\lastModifiedByUser\serviceProvisioningErrors + /// + public class ServiceProvisioningErrorsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance)."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ServiceProvisioningErrorsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/lastModifiedByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ServiceProvisioningErrorsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/lastModifiedByUser/serviceProvisioningErrors{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Errors published by a federated service describing a non-transient, service-specific error regarding the properties or link from a user object . Supports $filter (eq, not, for isResolved and serviceInstance). + /// + public class ServiceProvisioningErrorsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ListRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ListRequestBuilder.cs new file mode 100644 index 0000000000..0ae81051ef --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/ListRequestBuilder.cs @@ -0,0 +1,474 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Columns; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.ContentTypes; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.CreatedByUser; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Drive; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Items; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.LastModifiedByUser; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Operations; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Subscriptions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List +{ + /// + /// Provides operations to manage the list property of the microsoft.graph.drive entity. + /// + public class ListRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the columns property of the microsoft.graph.list entity. + /// + /// A + public Command BuildColumnsNavCommand() + { + var command = new Command("columns"); + command.Description = "Provides operations to manage the columns property of the microsoft.graph.list entity."; + var builder = new ColumnsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the contentTypes property of the microsoft.graph.list entity. + /// + /// A + public Command BuildContentTypesNavCommand() + { + var command = new Command("content-types"); + command.Description = "Provides operations to manage the contentTypes property of the microsoft.graph.list entity."; + var builder = new ContentTypesRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildAddCopyFromContentTypeHubNavCommand()); + nonExecCommands.Add(builder.BuildAddCopyNavCommand()); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildGetCompatibleHubContentTypesNavCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity. + /// + /// A + public Command BuildCreatedByUserNavCommand() + { + var command = new Command("created-by-user"); + command.Description = "Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity."; + var builder = new CreatedByUserRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMailboxSettingsNavCommand()); + nonExecCommands.Add(builder.BuildServiceProvisioningErrorsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property list for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property list for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the drive property of the microsoft.graph.list entity. + /// + /// A + public Command BuildDriveNavCommand() + { + var command = new Command("drive"); + command.Description = "Provides operations to manage the drive property of the microsoft.graph.list entity."; + var builder = new ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Drive.DriveRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// For drives in SharePoint, the underlying document library list. Read-only. Nullable. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "For drives in SharePoint, the underlying document library list. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the items property of the microsoft.graph.list entity. + /// + /// A + public Command BuildItemsNavCommand() + { + var command = new Command("items"); + command.Description = "Provides operations to manage the items property of the microsoft.graph.list entity."; + var builder = new ItemsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildCreateCommand()); + nonExecCommands.Add(builder.BuildDeltaNavCommand()); + nonExecCommands.Add(builder.BuildDeltaWithTokenRbCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity. + /// + /// A + public Command BuildLastModifiedByUserNavCommand() + { + var command = new Command("last-modified-by-user"); + command.Description = "Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity."; + var builder = new LastModifiedByUserRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildMailboxSettingsNavCommand()); + nonExecCommands.Add(builder.BuildServiceProvisioningErrorsNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Provides operations to manage the operations property of the microsoft.graph.list entity. + /// + /// A + public Command BuildOperationsNavCommand() + { + var command = new Command("operations"); + command.Description = "Provides operations to manage the operations property of the microsoft.graph.list entity."; + var builder = new OperationsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property list in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property list in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.List.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the subscriptions property of the microsoft.graph.list entity. + /// + /// A + public Command BuildSubscriptionsNavCommand() + { + var command = new Command("subscriptions"); + command.Description = "Provides operations to manage the subscriptions property of the microsoft.graph.list entity."; + var builder = new SubscriptionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ListRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ListRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property list for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// For drives in SharePoint, the underlying document library list. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property list in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.List body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.List body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// For drives in SharePoint, the underlying document library list. Read-only. Nullable. + /// + public class ListRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Operations/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Operations/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..2f3a134f55 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Operations/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Operations.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/operations/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/operations/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Operations/Item/RichLongRunningOperationItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Operations/Item/RichLongRunningOperationItemRequestBuilder.cs new file mode 100644 index 0000000000..b17d9b30fb --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Operations/Item/RichLongRunningOperationItemRequestBuilder.cs @@ -0,0 +1,280 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Operations.Item +{ + /// + /// Provides operations to manage the operations property of the microsoft.graph.list entity. + /// + public class RichLongRunningOperationItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property operations for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property operations for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var richLongRunningOperationIdOption = new Option("--rich-long-running-operation-id", description: "The unique identifier of richLongRunningOperation") { + }; + richLongRunningOperationIdOption.IsRequired = true; + command.AddOption(richLongRunningOperationIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var richLongRunningOperationId = invocationContext.ParseResult.GetValueForOption(richLongRunningOperationIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (richLongRunningOperationId is not null) requestInfo.PathParameters.Add("richLongRunningOperation%2Did", richLongRunningOperationId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The collection of long-running operations on the list. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The collection of long-running operations on the list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var richLongRunningOperationIdOption = new Option("--rich-long-running-operation-id", description: "The unique identifier of richLongRunningOperation") { + }; + richLongRunningOperationIdOption.IsRequired = true; + command.AddOption(richLongRunningOperationIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var richLongRunningOperationId = invocationContext.ParseResult.GetValueForOption(richLongRunningOperationIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (richLongRunningOperationId is not null) requestInfo.PathParameters.Add("richLongRunningOperation%2Did", richLongRunningOperationId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property operations in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property operations in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var richLongRunningOperationIdOption = new Option("--rich-long-running-operation-id", description: "The unique identifier of richLongRunningOperation") { + }; + richLongRunningOperationIdOption.IsRequired = true; + command.AddOption(richLongRunningOperationIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var richLongRunningOperationId = invocationContext.ParseResult.GetValueForOption(richLongRunningOperationIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RichLongRunningOperation.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (richLongRunningOperationId is not null) requestInfo.PathParameters.Add("richLongRunningOperation%2Did", richLongRunningOperationId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RichLongRunningOperationItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/operations/{richLongRunningOperation%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RichLongRunningOperationItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/operations/{richLongRunningOperation%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property operations for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of long-running operations on the list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property operations in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(RichLongRunningOperation body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(RichLongRunningOperation body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of long-running operations on the list. + /// + public class RichLongRunningOperationItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Operations/OperationsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Operations/OperationsRequestBuilder.cs new file mode 100644 index 0000000000..57d213f428 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Operations/OperationsRequestBuilder.cs @@ -0,0 +1,329 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Operations.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Operations.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Operations +{ + /// + /// Provides operations to manage the operations property of the microsoft.graph.list entity. + /// + public class OperationsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the operations property of the microsoft.graph.list entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var builder = new RichLongRunningOperationItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, new(0)); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to operations for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to operations for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(RichLongRunningOperation.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The collection of long-running operations on the list. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The collection of long-running operations on the list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public OperationsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/operations{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public OperationsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/operations{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The collection of long-running operations on the list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to operations for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RichLongRunningOperation body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RichLongRunningOperation body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The collection of long-running operations on the list. + /// + public class OperationsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..a3a52590ab --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Subscriptions.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/subscriptions/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/subscriptions/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/Item/Reauthorize/ReauthorizeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/Item/Reauthorize/ReauthorizeRequestBuilder.cs new file mode 100644 index 0000000000..c7b6e2cba1 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/Item/Reauthorize/ReauthorizeRequestBuilder.cs @@ -0,0 +1,92 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Subscriptions.Item.Reauthorize +{ + /// + /// Provides operations to call the reauthorize method. + /// + public class ReauthorizeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Reauthorize a subscription when you receive a reauthorizationRequired challenge. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Reauthorize a subscription when you receive a reauthorizationRequired challenge.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/subscription-reauthorize?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "The unique identifier of subscription") { + }; + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var subscriptionId = invocationContext.ParseResult.GetValueForOption(subscriptionIdOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToPostRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (subscriptionId is not null) requestInfo.PathParameters.Add("subscription%2Did", subscriptionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ReauthorizeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/subscriptions/{subscription%2Did}/reauthorize", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ReauthorizeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/subscriptions/{subscription%2Did}/reauthorize", rawUrl) + { + } + /// + /// Reauthorize a subscription when you receive a reauthorizationRequired challenge. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/Item/SubscriptionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/Item/SubscriptionItemRequestBuilder.cs new file mode 100644 index 0000000000..b2633c0808 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/Item/SubscriptionItemRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Subscriptions.Item.Reauthorize; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Subscriptions.Item +{ + /// + /// Provides operations to manage the subscriptions property of the microsoft.graph.list entity. + /// + public class SubscriptionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property subscriptions for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property subscriptions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "The unique identifier of subscription") { + }; + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var subscriptionId = invocationContext.ParseResult.GetValueForOption(subscriptionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (subscriptionId is not null) requestInfo.PathParameters.Add("subscription%2Did", subscriptionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The set of subscriptions on the list. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The set of subscriptions on the list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "The unique identifier of subscription") { + }; + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var subscriptionId = invocationContext.ParseResult.GetValueForOption(subscriptionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (subscriptionId is not null) requestInfo.PathParameters.Add("subscription%2Did", subscriptionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property subscriptions in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property subscriptions in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var subscriptionIdOption = new Option("--subscription-id", description: "The unique identifier of subscription") { + }; + subscriptionIdOption.IsRequired = true; + command.AddOption(subscriptionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var subscriptionId = invocationContext.ParseResult.GetValueForOption(subscriptionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Subscription.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (subscriptionId is not null) requestInfo.PathParameters.Add("subscription%2Did", subscriptionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the reauthorize method. + /// + /// A + public Command BuildReauthorizeNavCommand() + { + var command = new Command("reauthorize"); + command.Description = "Provides operations to call the reauthorize method."; + var builder = new ReauthorizeRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SubscriptionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/subscriptions/{subscription%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SubscriptionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/subscriptions/{subscription%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property subscriptions for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of subscriptions on the list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property subscriptions in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(Subscription body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(Subscription body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of subscriptions on the list. + /// + public class SubscriptionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/SubscriptionsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/SubscriptionsRequestBuilder.cs new file mode 100644 index 0000000000..0fba4ae5e2 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/List/Subscriptions/SubscriptionsRequestBuilder.cs @@ -0,0 +1,331 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Subscriptions.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Subscriptions.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.List.Subscriptions +{ + /// + /// Provides operations to manage the subscriptions property of the microsoft.graph.list entity. + /// + public class SubscriptionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the subscriptions property of the microsoft.graph.list entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new SubscriptionItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + executables.Add(builder.BuildPatchCommand()); + commands.Add(builder.BuildReauthorizeNavCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to subscriptions for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to subscriptions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(Subscription.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The set of subscriptions on the list. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The set of subscriptions on the list."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SubscriptionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/subscriptions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SubscriptionsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/list/subscriptions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The set of subscriptions on the list. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to subscriptions for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Subscription body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Subscription body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of subscriptions on the list. + /// + public class SubscriptionsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Recent/RecentGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Recent/RecentGetResponse.cs new file mode 100644 index 0000000000..92ae3646ce --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Recent/RecentGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Recent +{ + #pragma warning disable CS1591 + public class RecentGetResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new RecentGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RecentGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Recent/RecentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Recent/RecentRequestBuilder.cs new file mode 100644 index 0000000000..257670616c --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Recent/RecentRequestBuilder.cs @@ -0,0 +1,225 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Recent +{ + /// + /// Provides operations to call the recent method. + /// + public class RecentRequestBuilder : BaseCliRequestBuilder + { + /// + /// List a set of items that have been recently used by the signed in user.This collection includes items that are in the user's drive and items they have access to from other drives. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "List a set of items that have been recently used by the signed in user.This collection includes items that are in the user's drive and items they have access to from other drives.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/drive-recent?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RecentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/recent(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RecentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/recent(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// List a set of items that have been recently used by the signed in user.This collection includes items that are in the user's drive and items they have access to from other drives. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// List a set of items that have been recently used by the signed in user.This collection includes items that are in the user's drive and items they have access to from other drives. + /// + public class RecentRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Root/Content/ContentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Root/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000000..567704f382 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Root/Content/ContentRequestBuilder.cs @@ -0,0 +1,244 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Root.Content +{ + /// + /// Provides operations to manage the media for the storage entity. + /// + public class ContentRequestBuilder : BaseCliRequestBuilder + { + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var formatOption = new Option("--format", description: "Format of the content") { + }; + formatOption.IsRequired = false; + command.AddOption(formatOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var format = invocationContext.ParseResult.GetValueForOption(formatOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(format)) q.QueryParameters.Format = format; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildPutCommand() + { + var command = new Command("put"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var inputFileOption = new Option("--input-file", description: "Binary request body") { + }; + inputFileOption.IsRequired = true; + command.AddOption(inputFileOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var inputFile = invocationContext.ParseResult.GetValueForOption(inputFileOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + if (inputFile is null || !inputFile.Exists) { + Console.Error.WriteLine("No available file to send."); + return; + } + using var stream = inputFile.OpenRead(); + var requestInfo = ToPutRequestInformation(stream, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/root/content{?%24format*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/root/content{?%24format*}", rawUrl) + { + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Stream body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Stream body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetStreamContent(body, "application/octet-stream"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + public class ContentRequestBuilderGetQueryParameters + { + /// Format of the content +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("%24format")] + public string Format { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Root/RootRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Root/RootRequestBuilder.cs new file mode 100644 index 0000000000..3efb48ddf7 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Root/RootRequestBuilder.cs @@ -0,0 +1,156 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Root.Content; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Root +{ + /// + /// Provides operations to manage the root property of the microsoft.graph.drive entity. + /// + public class RootRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the media for the storage entity. + /// + /// A + public Command BuildContentNavCommand() + { + var command = new Command("content"); + command.Description = "Provides operations to manage the media for the storage entity."; + var builder = new ContentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPutCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// The root folder of the drive. Read-only. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The root folder of the drive. Read-only."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public RootRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/root{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public RootRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/root{?%24expand,%24select}", rawUrl) + { + } + /// + /// The root folder of the drive. Read-only. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The root folder of the drive. Read-only. + /// + public class RootRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/SearchWithQ/SearchWithQGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/SearchWithQ/SearchWithQGetResponse.cs new file mode 100644 index 0000000000..3a14c54a14 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/SearchWithQ/SearchWithQGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.SearchWithQ +{ + #pragma warning disable CS1591 + public class SearchWithQGetResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new SearchWithQGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SearchWithQGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/SearchWithQ/SearchWithQRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/SearchWithQ/SearchWithQRequestBuilder.cs new file mode 100644 index 0000000000..b1d3634de5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/SearchWithQ/SearchWithQRequestBuilder.cs @@ -0,0 +1,231 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.SearchWithQ +{ + /// + /// Provides operations to call the search method. + /// + public class SearchWithQRequestBuilder : BaseCliRequestBuilder + { + /// + /// Search the hierarchy of items for items matching a query.You can search within a folder hierarchy, a whole drive, or files shared with the current user. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Search the hierarchy of items for items matching a query.You can search within a folder hierarchy, a whole drive, or files shared with the current user.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/driveitem-search?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var qOption = new Option("-q", description: "Usage: q='{q}'") { + }; + qOption.IsRequired = true; + command.AddOption(qOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var q = invocationContext.ParseResult.GetValueForOption(qOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (q is not null) requestInfo.PathParameters.Add("q", q); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SearchWithQRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/search(q='{q}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SearchWithQRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/search(q='{q}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Search the hierarchy of items for items matching a query.You can search within a folder hierarchy, a whole drive, or files shared with the current user. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Search the hierarchy of items for items matching a query.You can search within a folder hierarchy, a whole drive, or files shared with the current user. + /// + public class SearchWithQRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/SharedWithMe/SharedWithMeGetResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/SharedWithMe/SharedWithMeGetResponse.cs new file mode 100644 index 0000000000..307746cdfd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/SharedWithMe/SharedWithMeGetResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.SharedWithMe +{ + #pragma warning disable CS1591 + public class SharedWithMeGetResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new SharedWithMeGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SharedWithMeGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.DriveItem.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/SharedWithMe/SharedWithMeRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/SharedWithMe/SharedWithMeRequestBuilder.cs new file mode 100644 index 0000000000..9a27b9bd79 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/SharedWithMe/SharedWithMeRequestBuilder.cs @@ -0,0 +1,225 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.SharedWithMe +{ + /// + /// Provides operations to call the sharedWithMe method. + /// + public class SharedWithMeRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get a list of driveItem objects shared with the owner of a drive. The driveItems returned from the sharedWithMe method always include the remoteItem facet that indicates they are items from a different drive. + /// Find more info here + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get a list of driveItem objects shared with the owner of a drive. The driveItems returned from the sharedWithMe method always include the remoteItem facet that indicates they are items from a different drive.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/drive-sharedwithme?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Select = select; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SharedWithMeRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/sharedWithMe(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SharedWithMeRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/sharedWithMe(){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Get a list of driveItem objects shared with the owner of a drive. The driveItems returned from the sharedWithMe method always include the remoteItem facet that indicates they are items from a different drive. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get a list of driveItem objects shared with the owner of a drive. The driveItems returned from the sharedWithMe method always include the remoteItem facet that indicates they are items from a different drive. + /// + public class SharedWithMeRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..edd82be01d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Special.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/special/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/special/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/Item/Content/ContentRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/Item/Content/ContentRequestBuilder.cs new file mode 100644 index 0000000000..5322265934 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/Item/Content/ContentRequestBuilder.cs @@ -0,0 +1,262 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Special.Item.Content +{ + /// + /// Provides operations to manage the media for the storage entity. + /// + public class ContentRequestBuilder : BaseCliRequestBuilder + { + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var formatOption = new Option("--format", description: "Format of the content") { + }; + formatOption.IsRequired = false; + command.AddOption(formatOption); + var outputFileOption = new Option("--output-file"); + command.AddOption(outputFileOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var format = invocationContext.ParseResult.GetValueForOption(formatOption); + var outputFile = invocationContext.ParseResult.GetValueForOption(outputFileOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(format)) q.QueryParameters.Format = format; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + if (outputFile == null) { + using var reader = new StreamReader(response); + var strContent = reader.ReadToEnd(); + Console.Write(strContent); + } + else { + using var writeStream = outputFile.OpenWrite(); + await response.CopyToAsync(writeStream); + Console.WriteLine($"Content written to {outputFile.FullName}."); + } + }); + return command; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + public Command BuildPutCommand() + { + var command = new Command("put"); + command.Description = "The content stream, if the item represents a file."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var inputFileOption = new Option("--input-file", description: "Binary request body") { + }; + inputFileOption.IsRequired = true; + command.AddOption(inputFileOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var inputFile = invocationContext.ParseResult.GetValueForOption(inputFileOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + if (inputFile is null || !inputFile.Exists) { + Console.Error.WriteLine("No available file to send."); + return; + } + using var stream = inputFile.OpenRead(); + var requestInfo = ToPutRequestInformation(stream, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public ContentRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/special/{driveItem%2Did}/content{?%24format*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public ContentRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/special/{driveItem%2Did}/content{?%24format*}", rawUrl) + { + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + /// A + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPutRequestInformation(Stream body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPutRequestInformation(Stream body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetStreamContent(body, "application/octet-stream"); + return requestInfo; + } + /// + /// The content stream, if the item represents a file. + /// + public class ContentRequestBuilderGetQueryParameters + { + /// Format of the content +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("%24format")] + public string Format { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/Item/DriveItemItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/Item/DriveItemItemRequestBuilder.cs new file mode 100644 index 0000000000..7839fdd6fc --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/Item/DriveItemItemRequestBuilder.cs @@ -0,0 +1,162 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Special.Item.Content; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Special.Item +{ + /// + /// Provides operations to manage the special property of the microsoft.graph.drive entity. + /// + public class DriveItemItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the media for the storage entity. + /// + /// A + public Command BuildContentNavCommand() + { + var command = new Command("content"); + command.Description = "Provides operations to manage the media for the storage entity."; + var builder = new ContentRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPutCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Collection of common folders available in OneDrive. Read-only. Nullable. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var driveItemIdOption = new Option("--drive-item-id", description: "The unique identifier of driveItem") { + }; + driveItemIdOption.IsRequired = true; + command.AddOption(driveItemIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var driveItemId = invocationContext.ParseResult.GetValueForOption(driveItemIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (driveItemId is not null) requestInfo.PathParameters.Add("driveItem%2Did", driveItemId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public DriveItemItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/special/{driveItem%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public DriveItemItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/special/{driveItem%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Collection of common folders available in OneDrive. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of common folders available in OneDrive. Read-only. Nullable. + /// + public class DriveItemItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/SpecialRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/SpecialRequestBuilder.cs new file mode 100644 index 0000000000..f9354daacd --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Drive/Special/SpecialRequestBuilder.cs @@ -0,0 +1,257 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Special.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive.Special.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Drive.Special +{ + /// + /// Provides operations to manage the special property of the microsoft.graph.drive entity. + /// + public class SpecialRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the special property of the microsoft.graph.drive entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new DriveItemItemRequestBuilder(PathParameters); + commands.Add(builder.BuildContentNavCommand()); + executables.Add(builder.BuildGetCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Collection of common folders available in OneDrive. Read-only. Nullable. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "Collection of common folders available in OneDrive. Read-only. Nullable."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public SpecialRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/special{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public SpecialRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/drive/special{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// Collection of common folders available in OneDrive. Read-only. Nullable. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Collection of common folders available in OneDrive. Read-only. Nullable. + /// + public class SpecialRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/FileStorageContainerItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/FileStorageContainerItemRequestBuilder.cs new file mode 100644 index 0000000000..cdc2721eae --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/FileStorageContainerItemRequestBuilder.cs @@ -0,0 +1,344 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Activate; +using ApiSdk.Storage.FileStorage.Containers.Item.Drive; +using ApiSdk.Storage.FileStorage.Containers.Item.Permissions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item +{ + /// + /// Provides operations to manage the containers property of the microsoft.graph.fileStorage entity. + /// + public class FileStorageContainerItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to call the activate method. + /// + /// A + public Command BuildActivateNavCommand() + { + var command = new Command("activate"); + command.Description = "Provides operations to call the activate method."; + var builder = new ActivateRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property containers for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property containers for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Provides operations to manage the drive property of the microsoft.graph.fileStorageContainer entity. + /// + /// A + public Command BuildDriveNavCommand() + { + var command = new Command("drive"); + command.Description = "Provides operations to manage the drive property of the microsoft.graph.fileStorageContainer entity."; + var builder = new DriveRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildBundlesNavCommand()); + nonExecCommands.Add(builder.BuildCreatedByUserNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + nonExecCommands.Add(builder.BuildFollowingNavCommand()); + execCommands.Add(builder.BuildGetCommand()); + nonExecCommands.Add(builder.BuildItemsNavCommand()); + nonExecCommands.Add(builder.BuildLastModifiedByUserNavCommand()); + nonExecCommands.Add(builder.BuildListNavCommand()); + execCommands.Add(builder.BuildPatchCommand()); + nonExecCommands.Add(builder.BuildRecentNavCommand()); + nonExecCommands.Add(builder.BuildRootNavCommand()); + nonExecCommands.Add(builder.BuildSearchWithQRbCommand()); + nonExecCommands.Add(builder.BuildSharedWithMeNavCommand()); + nonExecCommands.Add(builder.BuildSpecialNavCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Get containers from storage + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get containers from storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property containers in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property containers in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(FileStorageContainer.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to manage the permissions property of the microsoft.graph.fileStorageContainer entity. + /// + /// A + public Command BuildPermissionsNavCommand() + { + var command = new Command("permissions"); + command.Description = "Provides operations to manage the permissions property of the microsoft.graph.fileStorageContainer entity."; + var builder = new PermissionsRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FileStorageContainerItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FileStorageContainerItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property containers for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get containers from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property containers in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(FileStorageContainer body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(FileStorageContainer body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get containers from storage + /// + public class FileStorageContainerItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Permissions/Count/CountRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Count/CountRequestBuilder.cs new file mode 100644 index 0000000000..29efd36124 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Count/CountRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Permissions.Count +{ + /// + /// Provides operations to count the resources in the collection. + /// + public class CountRequestBuilder : BaseCliRequestBuilder + { + /// + /// Get the number of the resource + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get the number of the resource"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + var formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public CountRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/permissions/$count{?%24filter,%24search}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public CountRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/permissions/$count{?%24filter,%24search}", rawUrl) + { + } + /// + /// Get the number of the resource + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Get the number of the resource + /// + public class CountRequestBuilderGetQueryParameters + { + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/Grant/GrantPostRequestBody.cs b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/Grant/GrantPostRequestBody.cs new file mode 100644 index 0000000000..3038a186b5 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/Grant/GrantPostRequestBody.cs @@ -0,0 +1,73 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Permissions.Item.Grant +{ + #pragma warning disable CS1591 + public class GrantPostRequestBody : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The recipients property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Recipients { get; set; } +#nullable restore +#else + public List Recipients { get; set; } +#endif + /// The roles property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Roles { get; set; } +#nullable restore +#else + public List Roles { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GrantPostRequestBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static GrantPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GrantPostRequestBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "recipients", n => { Recipients = n.GetCollectionOfObjectValues(DriveRecipient.CreateFromDiscriminatorValue)?.ToList(); } }, + { "roles", n => { Roles = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("recipients", Recipients); + writer.WriteCollectionOfPrimitiveValues("roles", Roles); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/Grant/GrantPostResponse.cs b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/Grant/GrantPostResponse.cs new file mode 100644 index 0000000000..262ee1ed0d --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/Grant/GrantPostResponse.cs @@ -0,0 +1,54 @@ +// +using ApiSdk.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Permissions.Item.Grant +{ + #pragma warning disable CS1591 + public class GrantPostResponse : BaseCollectionPaginationCountResponse, IParsable + #pragma warning restore CS1591 + { + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Value { get; set; } +#nullable restore +#else + public List Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new GrantPostResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GrantPostResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "value", n => { Value = n.GetCollectionOfObjectValues(ApiSdk.Models.Permission.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("value", Value); + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/Grant/GrantRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/Grant/GrantRequestBuilder.cs new file mode 100644 index 0000000000..52ce112780 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/Grant/GrantRequestBuilder.cs @@ -0,0 +1,130 @@ +// +using ApiSdk.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Permissions.Item.Grant +{ + /// + /// Provides operations to call the grant method. + /// + public class GrantRequestBuilder : BaseCliRequestBuilder + { + /// + /// Grant users access to a link represented by a permission. + /// Find more info here + /// + /// A + public Command BuildPostCommand() + { + var command = new Command("post"); + command.Description = "Grant users access to a link represented by a permission.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/permission-grant?view=graph-rest-1.0"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var permissionIdOption = new Option("--permission-id", description: "The unique identifier of permission") { + }; + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var permissionId = invocationContext.ParseResult.GetValueForOption(permissionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(GrantPostRequestBody.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (permissionId is not null) requestInfo.PathParameters.Add("permission%2Did", permissionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public GrantRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/permissions/{permission%2Did}/grant", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public GrantRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/permissions/{permission%2Did}/grant", rawUrl) + { + } + /// + /// Grant users access to a link represented by a permission. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GrantPostRequestBody body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GrantPostRequestBody body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/PermissionItemRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/PermissionItemRequestBuilder.cs new file mode 100644 index 0000000000..9a48463d40 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Permissions/Item/PermissionItemRequestBuilder.cs @@ -0,0 +1,298 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Permissions.Item.Grant; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Permissions.Item +{ + /// + /// Provides operations to manage the permissions property of the microsoft.graph.fileStorageContainer entity. + /// + public class PermissionItemRequestBuilder : BaseCliRequestBuilder + { + /// + /// Delete navigation property permissions for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property permissions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var permissionIdOption = new Option("--permission-id", description: "The unique identifier of permission") { + }; + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var permissionId = invocationContext.ParseResult.GetValueForOption(permissionIdOption); + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (permissionId is not null) requestInfo.PathParameters.Add("permission%2Did", permissionId); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// The set of permissions for users in the fileStorageContainer. Permission for each user is set by the roles property. The possible values are 'reader', 'writer', 'manager', and 'owner'. Read-write. + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "The set of permissions for users in the fileStorageContainer. Permission for each user is set by the roles property. The possible values are 'reader', 'writer', 'manager', and 'owner'. Read-write."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var permissionIdOption = new Option("--permission-id", description: "The unique identifier of permission") { + }; + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var permissionId = invocationContext.ParseResult.GetValueForOption(permissionIdOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (permissionId is not null) requestInfo.PathParameters.Add("permission%2Did", permissionId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Provides operations to call the grant method. + /// + /// A + public Command BuildGrantNavCommand() + { + var command = new Command("grant"); + command.Description = "Provides operations to call the grant method."; + var builder = new GrantRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildPostCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Update the navigation property permissions in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property permissions in storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var permissionIdOption = new Option("--permission-id", description: "The unique identifier of permission") { + }; + permissionIdOption.IsRequired = true; + command.AddOption(permissionIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var permissionId = invocationContext.ParseResult.GetValueForOption(permissionIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.Permission.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + if (permissionId is not null) requestInfo.PathParameters.Add("permission%2Did", permissionId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PermissionItemRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/permissions/{permission%2Did}{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PermissionItemRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/permissions/{permission%2Did}{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property permissions for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of permissions for users in the fileStorageContainer. Permission for each user is set by the roles property. The possible values are 'reader', 'writer', 'manager', and 'owner'. Read-write. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property permissions in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Permission body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Permission body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of permissions for users in the fileStorageContainer. Permission for each user is set by the roles property. The possible values are 'reader', 'writer', 'manager', and 'owner'. Read-write. + /// + public class PermissionItemRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/FileStorage/Containers/Item/Permissions/PermissionsRequestBuilder.cs b/src/generated/Storage/FileStorage/Containers/Item/Permissions/PermissionsRequestBuilder.cs new file mode 100644 index 0000000000..fb07faa4b3 --- /dev/null +++ b/src/generated/Storage/FileStorage/Containers/Item/Permissions/PermissionsRequestBuilder.cs @@ -0,0 +1,331 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers.Item.Permissions.Count; +using ApiSdk.Storage.FileStorage.Containers.Item.Permissions.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage.Containers.Item.Permissions +{ + /// + /// Provides operations to manage the permissions property of the microsoft.graph.fileStorageContainer entity. + /// + public class PermissionsRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the permissions property of the microsoft.graph.fileStorageContainer entity. + /// + /// A Tuple<List<Command>, List<Command>> + public Tuple, List> BuildCommand() + { + var executables = new List(); + var commands = new List(); + var builder = new PermissionItemRequestBuilder(PathParameters); + executables.Add(builder.BuildDeleteCommand()); + executables.Add(builder.BuildGetCommand()); + commands.Add(builder.BuildGrantNavCommand()); + executables.Add(builder.BuildPatchCommand()); + return new(executables, commands); + } + /// + /// Provides operations to count the resources in the collection. + /// + /// A + public Command BuildCountNavCommand() + { + var command = new Command("count"); + command.Description = "Provides operations to count the resources in the collection."; + var builder = new CountRequestBuilder(PathParameters); + var execCommands = new List(); + execCommands.Add(builder.BuildGetCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Create new navigation property to permissions for storage + /// + /// A + public Command BuildCreateCommand() + { + var command = new Command("create"); + command.Description = "Create new navigation property to permissions for storage"; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.Permission.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPostRequestInformation(model, q => { + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// The set of permissions for users in the fileStorageContainer. Permission for each user is set by the roles property. The possible values are 'reader', 'writer', 'manager', and 'owner'. Read-write. + /// + /// A + public Command BuildListCommand() + { + var command = new Command("list"); + command.Description = "The set of permissions for users in the fileStorageContainer. Permission for each user is set by the roles property. The possible values are 'reader', 'writer', 'manager', and 'owner'. Read-write."; + var fileStorageContainerIdOption = new Option("--file-storage-container-id", description: "The unique identifier of fileStorageContainer") { + }; + fileStorageContainerIdOption.IsRequired = true; + command.AddOption(fileStorageContainerIdOption); + var topOption = new Option("--top", description: "Show only the first n items") { + }; + topOption.IsRequired = false; + command.AddOption(topOption); + var skipOption = new Option("--skip", description: "Skip the first n items") { + }; + skipOption.IsRequired = false; + command.AddOption(skipOption); + var searchOption = new Option("--search", description: "Search items by search phrases") { + }; + searchOption.IsRequired = false; + command.AddOption(searchOption); + var filterOption = new Option("--filter", description: "Filter items by property values") { + }; + filterOption.IsRequired = false; + command.AddOption(filterOption); + var countOption = new Option("--count", description: "Include count of items") { + }; + countOption.IsRequired = false; + command.AddOption(countOption); + var orderbyOption = new Option("--orderby", description: "Order items by property values") { + Arity = ArgumentArity.ZeroOrMore + }; + orderbyOption.IsRequired = false; + command.AddOption(orderbyOption); + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + var allOption = new Option("--all"); + command.AddOption(allOption); + command.SetHandler(async (invocationContext) => { + var fileStorageContainerId = invocationContext.ParseResult.GetValueForOption(fileStorageContainerIdOption); + var top = invocationContext.ParseResult.GetValueForOption(topOption); + var skip = invocationContext.ParseResult.GetValueForOption(skipOption); + var search = invocationContext.ParseResult.GetValueForOption(searchOption); + var filter = invocationContext.ParseResult.GetValueForOption(filterOption); + var count = invocationContext.ParseResult.GetValueForOption(countOption); + var orderby = invocationContext.ParseResult.GetValueForOption(orderbyOption); + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + var all = invocationContext.ParseResult.GetValueForOption(allOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + IPagingService pagingService = invocationContext.BindingContext.GetService(typeof(IPagingService)) as IPagingService ?? throw new ArgumentNullException("pagingService"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Top = top; + q.QueryParameters.Skip = skip; + if (!string.IsNullOrEmpty(search)) q.QueryParameters.Search = search; + if (!string.IsNullOrEmpty(filter)) q.QueryParameters.Filter = filter; + q.QueryParameters.Count = count; + q.QueryParameters.Orderby = orderby; + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + if (fileStorageContainerId is not null) requestInfo.PathParameters.Add("fileStorageContainer%2Did", fileStorageContainerId); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var pagingData = new PageLinkData(requestInfo, null, itemName: "value", nextLinkName: "@odata.nextLink"); + var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken); + var response = pageResponse?.Response; +#nullable enable + IOutputFormatter? formatter = null; +#nullable restore + if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) { + formatter = outputFormatterFactory.GetFormatter(output); + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + } else { + formatter = outputFormatterFactory.GetFormatter(FormatterType.TEXT); + } + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public PermissionsRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/permissions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public PermissionsRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage/containers/{fileStorageContainer%2Did}/permissions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", rawUrl) + { + } + /// + /// The set of permissions for users in the fileStorageContainer. Permission for each user is set by the roles property. The possible values are 'reader', 'writer', 'manager', and 'owner'. Read-write. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Create new navigation property to permissions for storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ApiSdk.Models.Permission body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ApiSdk.Models.Permission body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// The set of permissions for users in the fileStorageContainer. Permission for each user is set by the roles property. The possible values are 'reader', 'writer', 'manager', and 'owner'. Read-write. + /// + public class PermissionsRequestBuilderGetQueryParameters + { + /// Include count of items + [QueryParameter("%24count")] + public bool? Count { get; set; } + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Filter items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24filter")] + public string? Filter { get; set; } +#nullable restore +#else + [QueryParameter("%24filter")] + public string Filter { get; set; } +#endif + /// Order items by property values +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24orderby")] + public string[]? Orderby { get; set; } +#nullable restore +#else + [QueryParameter("%24orderby")] + public string[] Orderby { get; set; } +#endif + /// Search items by search phrases +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24search")] + public string? Search { get; set; } +#nullable restore +#else + [QueryParameter("%24search")] + public string Search { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + /// Skip the first n items + [QueryParameter("%24skip")] + public int? Skip { get; set; } + /// Show only the first n items + [QueryParameter("%24top")] + public int? Top { get; set; } + } + } +} diff --git a/src/generated/Storage/FileStorage/FileStorageRequestBuilder.cs b/src/generated/Storage/FileStorage/FileStorageRequestBuilder.cs new file mode 100644 index 0000000000..4896de6d7f --- /dev/null +++ b/src/generated/Storage/FileStorage/FileStorageRequestBuilder.cs @@ -0,0 +1,272 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage.Containers; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage.FileStorage +{ + /// + /// Provides operations to manage the fileStorage property of the microsoft.graph.storage entity. + /// + public class FileStorageRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the containers property of the microsoft.graph.fileStorage entity. + /// + /// A + public Command BuildContainersNavCommand() + { + var command = new Command("containers"); + command.Description = "Provides operations to manage the containers property of the microsoft.graph.fileStorage entity."; + var builder = new ContainersRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildCountNavCommand()); + execCommands.Add(builder.BuildCreateCommand()); + execCommands.Add(builder.BuildListCommand()); + var cmds = builder.BuildCommand(); + execCommands.AddRange(cmds.Item1); + nonExecCommands.AddRange(cmds.Item2); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands.OrderBy(static c => c.Name, StringComparer.Ordinal)) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Delete navigation property fileStorage for storage + /// + /// A + public Command BuildDeleteCommand() + { + var command = new Command("delete"); + command.Description = "Delete navigation property fileStorage for storage"; + var ifMatchOption = new Option("--if-match", description: "ETag") { + Arity = ArgumentArity.ZeroOrMore + }; + ifMatchOption.IsRequired = false; + command.AddOption(ifMatchOption); + command.SetHandler(async (invocationContext) => { + var ifMatch = invocationContext.ParseResult.GetValueForOption(ifMatchOption); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToDeleteRequestInformation(q => { + }); + if (ifMatch is not null) requestInfo.Headers.Add("If-Match", ifMatch); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + await reqAdapter.SendNoContentAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken); + Console.WriteLine("Success"); + }); + return command; + } + /// + /// Get fileStorage from storage + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get fileStorage from storage"; + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update the navigation property fileStorage in storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update the navigation property fileStorage in storage"; + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.FileStorage.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public FileStorageRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage/fileStorage{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public FileStorageRequestBuilder(string rawUrl) : base("{+baseurl}/storage/fileStorage{?%24expand,%24select}", rawUrl) + { + } + /// + /// Delete navigation property fileStorage for storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get fileStorage from storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update the navigation property fileStorage in storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.FileStorage body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.FileStorage body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get fileStorage from storage + /// + public class FileStorageRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Storage/StorageRequestBuilder.cs b/src/generated/Storage/StorageRequestBuilder.cs new file mode 100644 index 0000000000..d959097e98 --- /dev/null +++ b/src/generated/Storage/StorageRequestBuilder.cs @@ -0,0 +1,222 @@ +// +using ApiSdk.Models.ODataErrors; +using ApiSdk.Models; +using ApiSdk.Storage.FileStorage; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Cli.Commons.Extensions; +using Microsoft.Kiota.Cli.Commons.IO; +using Microsoft.Kiota.Cli.Commons; +using System.Collections.Generic; +using System.CommandLine; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace ApiSdk.Storage +{ + /// + /// Provides operations to manage the storage singleton. + /// + public class StorageRequestBuilder : BaseCliRequestBuilder + { + /// + /// Provides operations to manage the fileStorage property of the microsoft.graph.storage entity. + /// + /// A + public Command BuildFileStorageNavCommand() + { + var command = new Command("file-storage"); + command.Description = "Provides operations to manage the fileStorage property of the microsoft.graph.storage entity."; + var builder = new FileStorageRequestBuilder(PathParameters); + var execCommands = new List(); + var nonExecCommands = new List(); + nonExecCommands.Add(builder.BuildContainersNavCommand()); + execCommands.Add(builder.BuildDeleteCommand()); + execCommands.Add(builder.BuildGetCommand()); + execCommands.Add(builder.BuildPatchCommand()); + foreach (var cmd in execCommands) + { + command.AddCommand(cmd); + } + foreach (var cmd in nonExecCommands) + { + command.AddCommand(cmd); + } + return command; + } + /// + /// Get storage + /// + /// A + public Command BuildGetCommand() + { + var command = new Command("get"); + command.Description = "Get storage"; + var selectOption = new Option("--select", description: "Select properties to be returned") { + Arity = ArgumentArity.ZeroOrMore + }; + selectOption.IsRequired = false; + command.AddOption(selectOption); + var expandOption = new Option("--expand", description: "Expand related entities") { + Arity = ArgumentArity.ZeroOrMore + }; + expandOption.IsRequired = false; + command.AddOption(expandOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var select = invocationContext.ParseResult.GetValueForOption(selectOption); + var expand = invocationContext.ParseResult.GetValueForOption(expandOption); + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + var requestInfo = ToGetRequestInformation(q => { + q.QueryParameters.Select = select; + q.QueryParameters.Expand = expand; + }); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Update storage + /// + /// A + public Command BuildPatchCommand() + { + var command = new Command("patch"); + command.Description = "Update storage"; + var bodyOption = new Option("--body", description: "The request body") { + }; + bodyOption.IsRequired = true; + command.AddOption(bodyOption); + var outputOption = new Option("--output", () => FormatterType.JSON); + command.AddOption(outputOption); + var queryOption = new Option("--query"); + command.AddOption(queryOption); + command.SetHandler(async (invocationContext) => { + var body = invocationContext.ParseResult.GetValueForOption(bodyOption) ?? string.Empty; + var output = invocationContext.ParseResult.GetValueForOption(outputOption); + var query = invocationContext.ParseResult.GetValueForOption(queryOption); + IOutputFilter outputFilter = invocationContext.BindingContext.GetService(typeof(IOutputFilter)) as IOutputFilter ?? throw new ArgumentNullException("outputFilter"); + IOutputFormatterFactory outputFormatterFactory = invocationContext.BindingContext.GetService(typeof(IOutputFormatterFactory)) as IOutputFormatterFactory ?? throw new ArgumentNullException("outputFormatterFactory"); + var cancellationToken = invocationContext.GetCancellationToken(); + var reqAdapter = invocationContext.GetRequestAdapter(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(body)); + var parseNode = ParseNodeFactoryRegistry.DefaultInstance.GetRootParseNode("application/json", stream); + var model = parseNode.GetObjectValue(ApiSdk.Models.Storage.CreateFromDiscriminatorValue); + if (model is null) { + Console.Error.WriteLine("No model data to send."); + return; + } + var requestInfo = ToPatchRequestInformation(model, q => { + }); + requestInfo.SetContentFromParsable(reqAdapter, "application/json", model); + var errorMapping = new Dictionary> { + {"4XX", ODataError.CreateFromDiscriminatorValue}, + {"5XX", ODataError.CreateFromDiscriminatorValue}, + }; + var response = await reqAdapter.SendPrimitiveAsync(requestInfo, errorMapping: errorMapping, cancellationToken: cancellationToken) ?? Stream.Null; + response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response; + var formatter = outputFormatterFactory.GetFormatter(output); + await formatter.WriteOutputAsync(response, cancellationToken); + }); + return command; + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + public StorageRequestBuilder(Dictionary pathParameters) : base("{+baseurl}/storage{?%24expand,%24select}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + public StorageRequestBuilder(string rawUrl) : base("{+baseurl}/storage{?%24expand,%24select}", rawUrl) + { + } + /// + /// Get storage + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Update storage + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Storage body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(ApiSdk.Models.Storage body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Get storage + /// + public class StorageRequestBuilderGetQueryParameters + { + /// Expand related entities +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24expand")] + public string[]? Expand { get; set; } +#nullable restore +#else + [QueryParameter("%24expand")] + public string[] Expand { get; set; } +#endif + /// Select properties to be returned +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("%24select")] + public string[]? Select { get; set; } +#nullable restore +#else + [QueryParameter("%24select")] + public string[] Select { get; set; } +#endif + } + } +} diff --git a/src/generated/Teams/Item/Channels/Item/Members/Item/ConversationMemberItemRequestBuilder.cs b/src/generated/Teams/Item/Channels/Item/Members/Item/ConversationMemberItemRequestBuilder.cs index 5c3e9f4b5e..1f27d1cef3 100644 --- a/src/generated/Teams/Item/Channels/Item/Members/Item/ConversationMemberItemRequestBuilder.cs +++ b/src/generated/Teams/Item/Channels/Item/Members/Item/ConversationMemberItemRequestBuilder.cs @@ -22,14 +22,14 @@ namespace ApiSdk.Teams.Item.Channels.Item.Members.Item public class ConversationMemberItemRequestBuilder : BaseCliRequestBuilder { /// - /// Delete a conversationMember from a channel. - /// Find more info here + /// Delete a conversationMember from a channel. This operation is allowed only for channels with a membershipType value of private or shared. + /// Find more info here /// /// A public Command BuildDeleteCommand() { var command = new Command("delete"); - command.Description = "Delete a conversationMember from a channel.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/conversationmember-delete?view=graph-rest-1.0"; + command.Description = "Delete a conversationMember from a channel. This operation is allowed only for channels with a membershipType value of private or shared.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/channel-delete-members?view=graph-rest-1.0"; var teamIdOption = new Option("--team-id", description: "The unique identifier of team") { }; teamIdOption.IsRequired = true; @@ -135,14 +135,14 @@ public Command BuildGetCommand() return command; } /// - /// Update the role of a conversationMember in a channel. This operation is allowed only for channels with a membershipType value of private or shared. - /// Find more info here + /// Update the role of a conversationMember in a team or channel. + /// Find more info here /// /// A public Command BuildPatchCommand() { var command = new Command("patch"); - command.Description = "Update the role of a conversationMember in a channel. This operation is allowed only for channels with a membershipType value of private or shared.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/channel-update-members?view=graph-rest-1.0"; + command.Description = "Update the role of a conversationMember in a team or channel.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/conversationmember-update?view=graph-rest-1.0"; var teamIdOption = new Option("--team-id", description: "The unique identifier of team") { }; teamIdOption.IsRequired = true; @@ -213,7 +213,7 @@ public ConversationMemberItemRequestBuilder(string rawUrl) : base("{+baseurl}/te { } /// - /// Delete a conversationMember from a channel. + /// Delete a conversationMember from a channel. This operation is allowed only for channels with a membershipType value of private or shared. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -251,7 +251,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Update the role of a conversationMember in a channel. This operation is allowed only for channels with a membershipType value of private or shared. + /// Update the role of a conversationMember in a team or channel. /// /// A /// The request body diff --git a/src/generated/TenantRelationships/MultiTenantOrganization/MultiTenantOrganizationRequestBuilder.cs b/src/generated/TenantRelationships/MultiTenantOrganization/MultiTenantOrganizationRequestBuilder.cs index 7ea81de3e7..7179120dc7 100644 --- a/src/generated/TenantRelationships/MultiTenantOrganization/MultiTenantOrganizationRequestBuilder.cs +++ b/src/generated/TenantRelationships/MultiTenantOrganization/MultiTenantOrganizationRequestBuilder.cs @@ -89,14 +89,14 @@ public Command BuildJoinRequestNavCommand() return command; } /// - /// Update the properties of a multitenant organization. - /// Find more info here + /// Create a new multitenant organization. By default, the creator tenant becomes an owner tenant upon successful creation. Only owner tenants can manage a multitenant organization. + /// Find more info here /// /// A public Command BuildPutCommand() { var command = new Command("put"); - command.Description = "Update the properties of a multitenant organization.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/multitenantorganization-update?view=graph-rest-1.0"; + command.Description = "Create a new multitenant organization. By default, the creator tenant becomes an owner tenant upon successful creation. Only owner tenants can manage a multitenant organization.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/tenantrelationship-put-multitenantorganization?view=graph-rest-1.0"; var bodyOption = new Option("--body", description: "The request body") { }; bodyOption.IsRequired = true; @@ -195,7 +195,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Update the properties of a multitenant organization. + /// Create a new multitenant organization. By default, the creator tenant becomes an owner tenant upon successful creation. Only owner tenants can manage a multitenant organization. /// /// A /// The request body diff --git a/src/generated/Users/Item/Authentication/PasswordMethods/Item/PasswordAuthenticationMethodItemRequestBuilder.cs b/src/generated/Users/Item/Authentication/PasswordMethods/Item/PasswordAuthenticationMethodItemRequestBuilder.cs index 9302b015fc..e543ca7313 100644 --- a/src/generated/Users/Item/Authentication/PasswordMethods/Item/PasswordAuthenticationMethodItemRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/PasswordMethods/Item/PasswordAuthenticationMethodItemRequestBuilder.cs @@ -22,13 +22,13 @@ namespace ApiSdk.Users.Item.Authentication.PasswordMethods.Item public class PasswordAuthenticationMethodItemRequestBuilder : BaseCliRequestBuilder { /// - /// Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password. + /// Represents the password registered to a user for authentication. For security, the password itself is never returned in the object, but action can be taken to reset a password. /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password."; + command.Description = "Represents the password registered to a user for authentication. For security, the password itself is never returned in the object, but action can be taken to reset a password."; var userIdOption = new Option("--user-id", description: "The unique identifier of user. Use 'me' for the currently signed in user.") { }; userIdOption.IsRequired = true; @@ -94,7 +94,7 @@ public PasswordAuthenticationMethodItemRequestBuilder(string rawUrl) : base("{+b { } /// - /// Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password. + /// Represents the password registered to a user for authentication. For security, the password itself is never returned in the object, but action can be taken to reset a password. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -113,7 +113,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password. + /// Represents the password registered to a user for authentication. For security, the password itself is never returned in the object, but action can be taken to reset a password. /// public class PasswordAuthenticationMethodItemRequestBuilderGetQueryParameters { diff --git a/src/generated/Users/Item/Authentication/PasswordMethods/PasswordMethodsRequestBuilder.cs b/src/generated/Users/Item/Authentication/PasswordMethods/PasswordMethodsRequestBuilder.cs index ccdc1c9c36..e89f25a579 100644 --- a/src/generated/Users/Item/Authentication/PasswordMethods/PasswordMethodsRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/PasswordMethods/PasswordMethodsRequestBuilder.cs @@ -103,13 +103,13 @@ public Command BuildCreateCommand() return command; } /// - /// Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password. + /// Represents the password registered to a user for authentication. For security, the password itself is never returned in the object, but action can be taken to reset a password. /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password."; + command.Description = "Represents the password registered to a user for authentication. For security, the password itself is never returned in the object, but action can be taken to reset a password."; var userIdOption = new Option("--user-id", description: "The unique identifier of user. Use 'me' for the currently signed in user.") { }; userIdOption.IsRequired = true; @@ -219,7 +219,7 @@ public PasswordMethodsRequestBuilder(string rawUrl) : base("{+baseurl}/users/{us { } /// - /// Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password. + /// Represents the password registered to a user for authentication. For security, the password itself is never returned in the object, but action can be taken to reset a password. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -259,7 +259,7 @@ public RequestInformation ToPostRequestInformation(PasswordAuthenticationMethod return requestInfo; } /// - /// Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password. + /// Represents the password registered to a user for authentication. For security, the password itself is never returned in the object, but action can be taken to reset a password. /// public class PasswordMethodsRequestBuilderGetQueryParameters { diff --git a/src/generated/Users/Item/Authentication/SoftwareOathMethods/Item/SoftwareOathAuthenticationMethodItemRequestBuilder.cs b/src/generated/Users/Item/Authentication/SoftwareOathMethods/Item/SoftwareOathAuthenticationMethodItemRequestBuilder.cs index bd7d4d8a48..34b9d5934e 100644 --- a/src/generated/Users/Item/Authentication/SoftwareOathMethods/Item/SoftwareOathAuthenticationMethodItemRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/SoftwareOathMethods/Item/SoftwareOathAuthenticationMethodItemRequestBuilder.cs @@ -64,13 +64,13 @@ public Command BuildDeleteCommand() return command; } /// - /// The software OATH TOTP applications registered to a user for authentication. + /// The software OATH time-based one-time password (TOTP) applications registered to a user for authentication. /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "The software OATH TOTP applications registered to a user for authentication."; + command.Description = "The software OATH time-based one-time password (TOTP) applications registered to a user for authentication."; var userIdOption = new Option("--user-id", description: "The unique identifier of user. Use 'me' for the currently signed in user.") { }; userIdOption.IsRequired = true; @@ -155,7 +155,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// The software OATH TOTP applications registered to a user for authentication. + /// The software OATH time-based one-time password (TOTP) applications registered to a user for authentication. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -174,7 +174,7 @@ public RequestInformation ToGetRequestInformation(Action - /// The software OATH TOTP applications registered to a user for authentication. + /// The software OATH time-based one-time password (TOTP) applications registered to a user for authentication. /// public class SoftwareOathAuthenticationMethodItemRequestBuilderGetQueryParameters { diff --git a/src/generated/Users/Item/Authentication/SoftwareOathMethods/SoftwareOathMethodsRequestBuilder.cs b/src/generated/Users/Item/Authentication/SoftwareOathMethods/SoftwareOathMethodsRequestBuilder.cs index befeb9adf9..afba4d5e3c 100644 --- a/src/generated/Users/Item/Authentication/SoftwareOathMethods/SoftwareOathMethodsRequestBuilder.cs +++ b/src/generated/Users/Item/Authentication/SoftwareOathMethods/SoftwareOathMethodsRequestBuilder.cs @@ -53,13 +53,13 @@ public Command BuildCountNavCommand() return command; } /// - /// The software OATH TOTP applications registered to a user for authentication. + /// The software OATH time-based one-time password (TOTP) applications registered to a user for authentication. /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "The software OATH TOTP applications registered to a user for authentication."; + command.Description = "The software OATH time-based one-time password (TOTP) applications registered to a user for authentication."; var userIdOption = new Option("--user-id", description: "The unique identifier of user. Use 'me' for the currently signed in user.") { }; userIdOption.IsRequired = true; @@ -169,7 +169,7 @@ public SoftwareOathMethodsRequestBuilder(string rawUrl) : base("{+baseurl}/users { } /// - /// The software OATH TOTP applications registered to a user for authentication. + /// The software OATH time-based one-time password (TOTP) applications registered to a user for authentication. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -188,7 +188,7 @@ public RequestInformation ToGetRequestInformation(Action - /// The software OATH TOTP applications registered to a user for authentication. + /// The software OATH time-based one-time password (TOTP) applications registered to a user for authentication. /// public class SoftwareOathMethodsRequestBuilderGetQueryParameters { diff --git a/src/generated/Users/Item/UserItemRequestBuilder.cs b/src/generated/Users/Item/UserItemRequestBuilder.cs index 34d1f768d6..65d9de21bf 100644 --- a/src/generated/Users/Item/UserItemRequestBuilder.cs +++ b/src/generated/Users/Item/UserItemRequestBuilder.cs @@ -836,14 +836,14 @@ public Command BuildFollowedSitesNavCommand() return command; } /// - /// Retrieve the properties and relationships of user object. This operation returns by default only a subset of the more commonly used properties for each user. These default properties are noted in the Properties section. To get properties that are not returned by default, do a GET operation for the user and specify the properties in a $select OData query option. Because the user resource supports extensions, you can also use the GET operation to get custom properties and extension data in a user instance. Customers through Microsoft Entra ID for customers can also use this API operation to retrieve their details. - /// Find more info here + /// Read properties and relationships of the user object. + /// Find more info here /// /// A public Command BuildGetCommand() { var command = new Command("get"); - command.Description = "Retrieve the properties and relationships of user object. This operation returns by default only a subset of the more commonly used properties for each user. These default properties are noted in the Properties section. To get properties that are not returned by default, do a GET operation for the user and specify the properties in a $select OData query option. Because the user resource supports extensions, you can also use the GET operation to get custom properties and extension data in a user instance. Customers through Microsoft Entra ID for customers can also use this API operation to retrieve their details.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/user-get?view=graph-rest-1.0"; + command.Description = "Read properties and relationships of the user object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-mam-user-get?view=graph-rest-1.0"; var userIdOption = new Option("--user-id", description: "The unique identifier of user. Use 'me' for the currently signed in user.") { }; userIdOption.IsRequired = true; @@ -2053,7 +2053,7 @@ public RequestInformation ToDeleteRequestInformation(Action - /// Retrieve the properties and relationships of user object. This operation returns by default only a subset of the more commonly used properties for each user. These default properties are noted in the Properties section. To get properties that are not returned by default, do a GET operation for the user and specify the properties in a $select OData query option. Because the user resource supports extensions, you can also use the GET operation to get custom properties and extension data in a user instance. Customers through Microsoft Entra ID for customers can also use this API operation to retrieve their details. + /// Read properties and relationships of the user object. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -2093,7 +2093,7 @@ public RequestInformation ToPatchRequestInformation(ApiSdk.Models.User body, Act return requestInfo; } /// - /// Retrieve the properties and relationships of user object. This operation returns by default only a subset of the more commonly used properties for each user. These default properties are noted in the Properties section. To get properties that are not returned by default, do a GET operation for the user and specify the properties in a $select OData query option. Because the user resource supports extensions, you can also use the GET operation to get custom properties and extension data in a user instance. Customers through Microsoft Entra ID for customers can also use this API operation to retrieve their details. + /// Read properties and relationships of the user object. /// public class UserItemRequestBuilderGetQueryParameters { diff --git a/src/generated/Users/UsersRequestBuilder.cs b/src/generated/Users/UsersRequestBuilder.cs index 44afaa99be..22ccc0f795 100644 --- a/src/generated/Users/UsersRequestBuilder.cs +++ b/src/generated/Users/UsersRequestBuilder.cs @@ -134,14 +134,14 @@ public Command BuildCountNavCommand() return command; } /// - /// Create a new user object. - /// Find more info here + /// Create a new user.The request body contains the user to create. At a minimum, you must specify the required properties for the user. You can optionally specify any other writable properties. + /// Find more info here /// /// A public Command BuildCreateCommand() { var command = new Command("create"); - command.Description = "Create a new user object.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-user-create?view=graph-rest-1.0"; + command.Description = "Create a new user.The request body contains the user to create. At a minimum, you must specify the required properties for the user. You can optionally specify any other writable properties.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/user-post-users?view=graph-rest-1.0"; var bodyOption = new Option("--body", description: "The request body") { }; bodyOption.IsRequired = true; @@ -231,14 +231,14 @@ public Command BuildGetByIdsNavCommand() return command; } /// - /// List properties and relationships of the user objects. - /// Find more info here + /// Retrieve a list of user objects. + /// Find more info here /// /// A public Command BuildListCommand() { var command = new Command("list"); - command.Description = "List properties and relationships of the user objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/intune-onboarding-user-list?view=graph-rest-1.0"; + command.Description = "Retrieve a list of user objects.\n\nFind more info here:\n https://learn.microsoft.com/graph/api/user-list?view=graph-rest-1.0"; var consistencyLevelOption = new Option("--consistency-level", description: "Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries") { Arity = ArgumentArity.ZeroOrMore }; @@ -360,7 +360,7 @@ public UsersRequestBuilder(string rawUrl) : base("{+baseurl}/users{?%24count,%24 { } /// - /// List properties and relationships of the user objects. + /// Retrieve a list of user objects. /// /// A /// Configuration for the request such as headers, query parameters, and middleware options. @@ -379,7 +379,7 @@ public RequestInformation ToGetRequestInformation(Action - /// Create a new user object. + /// Create a new user.The request body contains the user to create. At a minimum, you must specify the required properties for the user. You can optionally specify any other writable properties. /// /// A /// The request body @@ -400,7 +400,7 @@ public RequestInformation ToPostRequestInformation(ApiSdk.Models.User body, Acti return requestInfo; } /// - /// List properties and relationships of the user objects. + /// Retrieve a list of user objects. /// public class UsersRequestBuilderGetQueryParameters { diff --git a/src/generated/kiota-lock.json b/src/generated/kiota-lock.json index 0157ac1d09..4b3ac14111 100644 --- a/src/generated/kiota-lock.json +++ b/src/generated/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "2BE07407CFC7E51B2F7C4F00D533B957E4C24DABE6B08C1CD1EC7F89AE142F46477CFC82D26CDE5F523AA19B8216A6070305B7E90500D57F238CAD73ED8C7524", + "descriptionHash": "228DBD2669F051EAF07E85C0B4785D1ED3E57A28022B67D64ACC2F757756E39FA2792C9324E9E816D2E0191098BEE72BE55B1BC266D5194B89F2E51E5A9AE670", "descriptionLocation": "../../msgraph-metadata/clean_v10_openapi/openapi.yaml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.15.0",